Fix chat template (#1)
Browse files- Fix chat template (73d6c973580e0922293b9d7c80f7dbc3f03d4c97)
Co-authored-by: Pedro Cuenca <pcuenq@users.noreply.huggingface.co>
- chat_template.json +1 -1
- tokenizer_config.json +1 -1
chat_template.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
{
|
2 |
-
"chat_template": "<|im_start|>{% for message in messages %}{{message['role']
|
3 |
}
|
|
|
1 |
{
|
2 |
+
"chat_template": "<|im_start|>{% for message in messages %}{{message['role'] | capitalize}}{% if message['content'][0]['type'] == 'image' %}{{':'}}{% else %}{{': '}}{% endif %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{{line['text']}}{% elif line['type'] == 'image' %}{{ '<image>' }}{% endif %}{% endfor %}<end_of_utterance>\n{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}"
|
3 |
}
|
tokenizer_config.json
CHANGED
@@ -1168,7 +1168,7 @@
|
|
1168 |
"<end_of_utterance>"
|
1169 |
],
|
1170 |
"bos_token": "<|im_start|>",
|
1171 |
-
"chat_template": "<|im_start|>{% for message in messages %}{{message['role']
|
1172 |
"clean_up_tokenization_spaces": false,
|
1173 |
"end_of_utterance_token": "<end_of_utterance>",
|
1174 |
"eos_token": "<end_of_utterance>",
|
|
|
1168 |
"<end_of_utterance>"
|
1169 |
],
|
1170 |
"bos_token": "<|im_start|>",
|
1171 |
+
"chat_template": "<|im_start|>{% for message in messages %}{{message['role'] | capitalize}}{% if message['content'][0]['type'] == 'image' %}{{':'}}{% else %}{{': '}}{% endif %}{% for line in message['content'] %}{% if line['type'] == 'text' %}{{line['text']}}{% elif line['type'] == 'image' %}{{ '<image>' }}{% endif %}{% endfor %}<end_of_utterance>\n{% endfor %}{% if add_generation_prompt %}{{ 'Assistant:' }}{% endif %}",
|
1172 |
"clean_up_tokenization_spaces": false,
|
1173 |
"end_of_utterance_token": "<end_of_utterance>",
|
1174 |
"eos_token": "<end_of_utterance>",
|