Fixed chat template. (#4)
Browse files- Fixed chat template. (a0f71d8ecfaceca432e76ae37abefdd0e8cfb7a2)
- Should be OK now. (e93c8bcb0f2b1b588f112e8f842c2c9559f8066b)
Co-authored-by: LagPixelLOL <[email protected]>
- tokenizer_config.json +3 -3
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,6 +40,5 @@
|
|
39 |
"spaces_between_special_tokens": false,
|
40 |
"tokenizer_class": "LlamaTokenizer",
|
41 |
"unk_token": "<unk>",
|
42 |
-
"use_default_system_prompt": true
|
43 |
-
|
44 |
-
}
|
|
|
29 |
},
|
30 |
"additional_special_tokens": [],
|
31 |
"bos_token": "<s>",
|
32 |
+
"chat_template": "{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{{ messages[0]['content'].strip() }}{% else %}{% set loop_messages = messages %}{{ 'A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user\\'s questions.' }}{% endif %}{% for message in loop_messages %}{% if loop.index0 == 0 %}{% if message['role'] == 'system' or message['role'] == 'user' %}{{ ' USER: ' + message['content'].strip() }}{% else %}{{ ' ASSISTANT: ' + message['content'].strip() + eos_token }}{% endif %}{% else %}{% if message['role'] == 'system' or message['role'] == 'user' %}{{ '\nUSER: ' + message['content'].strip() }}{% else %}{{ ' ASSISTANT: ' + message['content'].strip() + eos_token }}{% endif %}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ ' ASSISTANT:' }}{% endif %}",
|
33 |
"clean_up_tokenization_spaces": false,
|
34 |
"eos_token": "</s>",
|
35 |
"legacy": true,
|
|
|
40 |
"spaces_between_special_tokens": false,
|
41 |
"tokenizer_class": "LlamaTokenizer",
|
42 |
"unk_token": "<unk>",
|
43 |
+
"use_default_system_prompt": true
|
44 |
+
}
|
|