8000 Update moondream chat format · Scofflawvii/llama-cpp-python@1705893 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1705893

Browse files
committed
Update moondream chat format
1 parent 7df9483 commit 1705893

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llama_cpp/llama_chat_format.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2486,16 +2486,21 @@ class MoondreamChatHanlder(Llava15ChatHandler):
24862486
"{% if message.content is iterable %}"
24872487
"{% for content in message.content %}"
24882488
"{% if content.type == 'image_url' %}"
2489+
"{% if content.image_url is string %}"
24892490
"{{ content.image_url }}\n\n"
24902491
"{% endif %}"
2492+
"{% if content.image_url is mapping %}"
2493+
"{{ content.image_url.url }}\n\n"
2494+
"{% endif %}"
2495+
"{% endif %}"
24912496
"{% if content.type == 'text' %}"
24922497
"Question: {{ content.text }}\n\n"
24932498
"{% endif %}"
24942499
"{% endfor %}"
24952500
"{% endif %}"
24962501
"{% endif %}"
24972502
"{% if message.role == 'assistant' %}"
2498-
"Answer:{{ message.content }}"
2503+
"Answer:{{ message.content }}\n\n"
24992504
"{% endif %}"
25002505
"{% endfor %}"
25012506
"{% if add_generation_prompt %}"

0 commit comments

Comments
 (0)
0