File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -3459,26 +3459,29 @@ class Qwen25VLChatHandler(Llava15ChatHandler):
3459
3459
DEFAULT_SYSTEM_MESSAGE = "You are a helpful assistant."
3460
3460
3461
3461
CHAT_FORMAT = (
3462
- "<|im_start|>system \n "
3463
- "You are a helpful assistant.<|im_end|> \n "
3462
+ #"{% set image_count = namespace(value=0) %} "
3463
+ #"{% set video_count = namespace(value=0) %} "
3464
3464
"{% for message in messages %}"
3465
- "{% if message['role'] == 'user' %}"
3466
- "<|im_start|>user\n "
3465
+ "{% if loop.first and message['role'] != 'system' %}"
3466
+ "<|im_start|>system\n "
3467
+ "{{ self.DEFAULT_SYSTEM_MESSAGE }}<|im_end|>\n "
3468
+ "{% endif %}"
3469
+ "<|im_start|>{{ message['role'] }}\n "
3467
3470
"{% if message['content'] is string %}"
3468
- "{{ message['content'] }}"
3471
+ "{{ message['content'] }}<|im_end|> \n "
3469
3472
"{% else %}"
3470
3473
"{% for content in message['content'] %}"
3471
- "{% if content['type'] == 'text' %}"
3472
- "{{ content['text'] }}"
3473
- "{% elif content['type'] == 'image_url' %}"
3474
+ "{% if content['type'] == 'image_url' %}"
3474
3475
"{% if content.image_url is string %}"
3475
3476
"{{ content.image_url }}"
3476
3477
"{% else %}"
3477
3478
"{{ content.image_url.url }}"
3478
3479
"{% endif %}"
3480
+ #"{% set image_count.value = image_count.value + 1 %}"
3481
+ "{% elif content['type'] == 'text' %}"
3482
+ "{{ content['text'] }}"
3479
3483
"{% endif %}"
3480
3484
"{% endfor %}"
3481
- "{% endif %}"
3482
3485
"<|im_end|>\n "
3483
3486
"{% endif %}"
3484
3487
"{% endfor %}"
You can’t perform that action at this time.
0 commit comments