Commit
•
adc3b68
1
Parent(s):
db43d19
Add chat template from mistralai/Mistral-7B-Instruct-v0.2 (#3)
Browse files- Add chat template from mistralai/Mistral-7B-Instruct-v0.2 (70970428e3d9d57472c14951027f216497457e26)
Co-authored-by: Amgad Hasan <amgadhasan@users.noreply.huggingface.co>
- tokenizer_config.json +5 -1
tokenizer_config.json
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
{
|
|
|
|
|
|
|
2 |
"added_tokens_decoder": {
|
3 |
"0": {
|
4 |
"content": "<unk>",
|
@@ -27,9 +30,10 @@
|
|
27 |
},
|
28 |
"additional_special_tokens": [],
|
29 |
"bos_token": "<s>",
|
|
|
30 |
"clean_up_tokenization_spaces": false,
|
31 |
"eos_token": "</s>",
|
32 |
-
"legacy":
|
33 |
"model_max_length": 1000000000000000019884624838656,
|
34 |
"pad_token": null,
|
35 |
"sp_model_kwargs": {},
|
|
|
1 |
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
"added_tokens_decoder": {
|
6 |
"0": {
|
7 |
"content": "<unk>",
|
|
|
30 |
},
|
31 |
"additional_special_tokens": [],
|
32 |
"bos_token": "<s>",
|
33 |
+
"chat_template": "{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content'] %}\n {%- set loop_messages = messages[1:] %}\n{%- else %}\n {%- set loop_messages = messages %}\n{%- endif %}\n\n{{- bos_token }}\n{%- for message in loop_messages %}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}\n {{- raise_exception('After the optional system message, conversation roles must alternate user/assistant/user/assistant/...') }}\n {%- endif %}\n {%- if message['role'] == 'user' %}\n {%- if loop.first and system_message is defined %}\n {{- ' [INST] ' + system_message + '\\n\\n' + message['content'] + ' [/INST]' }}\n {%- else %}\n {{- ' [INST] ' + message['content'] + ' [/INST]' }}\n {%- endif %}\n {%- elif message['role'] == 'assistant' %}\n {{- ' ' + message['content'] + eos_token}}\n {%- else %}\n {{- raise_exception('Only user and assistant roles are supported, with the exception of an initial optional system message!') }}\n {%- endif %}\n{%- endfor %}\n",
|
34 |
"clean_up_tokenization_spaces": false,
|
35 |
"eos_token": "</s>",
|
36 |
+
"legacy": false,
|
37 |
"model_max_length": 1000000000000000019884624838656,
|
38 |
"pad_token": null,
|
39 |
"sp_model_kwargs": {},
|