Added chat template
Browse files- tokenizer_config.json +1 -0
tokenizer_config.json
CHANGED
@@ -33,6 +33,7 @@
|
|
33 |
"bos_token": "<s>",
|
34 |
"clean_up_tokenization_spaces": false,
|
35 |
"eos_token": "</s>",
|
|
|
36 |
"legacy": true,
|
37 |
"model_max_length": 1000000000000000019884624838656,
|
38 |
"pad_token": null,
|
|
|
33 |
"bos_token": "<s>",
|
34 |
"clean_up_tokenization_spaces": false,
|
35 |
"eos_token": "</s>",
|
36 |
+
"chat_template": "{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% set system_message = 'You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don\'t know the answer to a question, please don\'t share false information.' %}{% endif %}{{ '### System:\n' + system_message.strip() + '\n' }}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '### User:\n' + content.strip() + '\n' }}{% elif message['role'] == 'assistant' %}{{ '### Assistant:\n' + content.strip() + '\n'}}{% endif %}{% endfor %}",
|
37 |
"legacy": true,
|
38 |
"model_max_length": 1000000000000000019884624838656,
|
39 |
"pad_token": null,
|