File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -2485,6 +2485,8 @@ class MoondreamChatHanlder(Llava15ChatHandler):
2485
2485
"{% if message.role == 'user' %}"
2486
2486
"{% if message.content is iterable %}"
2487
2487
"{% for content in message.content %}"
2488
+
2489
+ # <image>
2488
2490
"{% if content.type == 'image_url' %}"
2489
2491
"{% if content.image_url is string %}"
2490
2492
"{{ content.image_url }}\n \n "
@@ -2493,16 +2495,28 @@ class MoondreamChatHanlder(Llava15ChatHandler):
2493
2495
"{{ content.image_url.url }}\n \n "
2494
2496
"{% endif %}"
2495
2497
"{% endif %}"
2498
+
2499
+ # Question:
2496
2500
"{% if content.type == 'text' %}"
2497
2501
"Question: {{ content.text }}\n \n "
2498
2502
"{% endif %}"
2499
2503
"{% endfor %}"
2500
2504
"{% endif %}"
2505
+
2506
+ # Question:
2507
+ "{% if message.content is string %}"
2508
+ "Question: {{ message.content }}\n \n "
2509
+ "{% endif %}"
2510
+
2501
2511
"{% endif %}"
2512
+
2513
+ # Answer:
2502
2514
"{% if message.role == 'assistant' %}"
2503
2515
"Answer:{{ message.content }}\n \n "
2504
2516
"{% endif %}"
2505
2517
"{% endfor %}"
2518
+
2519
+ # Generation prompt
2506
2520
"{% if add_generation_prompt %}"
2507
2521
"Answer:"
2508
2522
"{% endif %}"
You can’t perform that action at this time.
0 commit comments