Upload tokenizer
Browse files- chat_template.jinja +24 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer_config.json +0 -0
chat_template.jinja
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 2 |
+
{%- set system_message = messages[0]['content'] %}
|
| 3 |
+
{%- set loop_messages = messages[1:] %}
|
| 4 |
+
{%- else %}
|
| 5 |
+
{%- set loop_messages = messages %}
|
| 6 |
+
{%- endif %}
|
| 7 |
+
|
| 8 |
+
{{- bos_token }}
|
| 9 |
+
{%- for message in loop_messages %}
|
| 10 |
+
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}
|
| 11 |
+
{{- raise_exception('After the optional system message, conversation roles must alternate user/assistant/user/assistant/...') }}
|
| 12 |
+
{%- endif %}
|
| 13 |
+
{%- if message['role'] == 'user' %}
|
| 14 |
+
{%- if loop.last and system_message is defined %}
|
| 15 |
+
{{- '[INST] ' + system_message + '\n\n' + message['content'] + '[/INST]' }}
|
| 16 |
+
{%- else %}
|
| 17 |
+
{{- '[INST] ' + message['content'] + '[/INST]' }}
|
| 18 |
+
{%- endif %}
|
| 19 |
+
{%- elif message['role'] == 'assistant' %}
|
| 20 |
+
{{- ' ' + message['content'] + eos_token}}
|
| 21 |
+
{%- else %}
|
| 22 |
+
{{- raise_exception('Only user and assistant roles are supported, with the exception of an initial optional system message!') }}
|
| 23 |
+
{%- endif %}
|
| 24 |
+
{%- endfor %}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "</s>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"unk_token": {
|
| 17 |
+
"content": "<unk>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
}
|
| 23 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|