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):
34593459 DEFAULT_SYSTEM_MESSAGE = "You are a helpful assistant."
34603460
34613461 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) %} "
34643464 "{% 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 "
34673470 "{% if message['content'] is string %}"
3468- "{{ message['content'] }}"
3471+ "{{ message['content'] }}<|im_end|> \n "
34693472 "{% else %}"
34703473 "{% 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' %}"
34743475 "{% if content.image_url is string %}"
34753476 "{{ content.image_url }}"
34763477 "{% else %}"
34773478 "{{ content.image_url.url }}"
34783479 "{% endif %}"
3480+ #"{% set image_count.value = image_count.value + 1 %}"
3481+ "{% elif content['type'] == 'text' %}"
3482+ "{{ content['text'] }}"
34793483 "{% endif %}"
34803484 "{% endfor %}"
3481- "{% endif %}"
34823485 "<|im_end|>\n "
34833486 "{% endif %}"
34843487 "{% endfor %}"
You can’t perform that action at this time.
0 commit comments