Rijgersberg
commited on
Commit
•
c6ed711
1
Parent(s):
0c58fc9
Add Zephyr-style chat template
Browse files- tokenizer_config.json +2 -1
tokenizer_config.json
CHANGED
@@ -29,6 +29,7 @@
|
|
29 |
},
|
30 |
"additional_special_tokens": [],
|
31 |
"bos_token": "<s>",
|
|
|
32 |
"clean_up_tokenization_spaces": false,
|
33 |
"eos_token": "</s>",
|
34 |
"legacy": true,
|
@@ -39,4 +40,4 @@
|
|
39 |
"tokenizer_class": "LlamaTokenizer",
|
40 |
"unk_token": "<unk>",
|
41 |
"use_default_system_prompt": true
|
42 |
-
}
|
|
|
29 |
},
|
30 |
"additional_special_tokens": [],
|
31 |
"bos_token": "<s>",
|
32 |
+
"chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
|
33 |
"clean_up_tokenization_spaces": false,
|
34 |
"eos_token": "</s>",
|
35 |
"legacy": true,
|
|
|
40 |
"tokenizer_class": "LlamaTokenizer",
|
41 |
"unk_token": "<unk>",
|
42 |
"use_default_system_prompt": true
|
43 |
+
}
|