Upload tokenizer
Browse files- chat_template.jinja +4 -47
- special_tokens_map.json +6 -5
- tokenizer.json +2 -2
- tokenizer.model +2 -2
- tokenizer_config.json +0 -0
chat_template.jinja
CHANGED
|
@@ -1,47 +1,4 @@
|
|
| 1 |
-
{{ bos_token }}
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
' -%}
|
| 7 |
-
{%- else -%}
|
| 8 |
-
{%- set first_user_prefix = messages[0]['content'][0]['text'] + '
|
| 9 |
-
|
| 10 |
-
' -%}
|
| 11 |
-
{%- endif -%}
|
| 12 |
-
{%- set loop_messages = messages[1:] -%}
|
| 13 |
-
{%- else -%}
|
| 14 |
-
{%- set first_user_prefix = "" -%}
|
| 15 |
-
{%- set loop_messages = messages -%}
|
| 16 |
-
{%- endif -%}
|
| 17 |
-
{%- for message in loop_messages -%}
|
| 18 |
-
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
|
| 19 |
-
{{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
|
| 20 |
-
{%- endif -%}
|
| 21 |
-
{%- if (message['role'] == 'assistant') -%}
|
| 22 |
-
{%- set role = "model" -%}
|
| 23 |
-
{%- else -%}
|
| 24 |
-
{%- set role = message['role'] -%}
|
| 25 |
-
{%- endif -%}
|
| 26 |
-
{{ '<start_of_turn>' + role + '
|
| 27 |
-
' + (first_user_prefix if loop.first else "") }}
|
| 28 |
-
{%- if message['content'] is string -%}
|
| 29 |
-
{{ message['content'] | trim }}
|
| 30 |
-
{%- elif message['content'] is iterable -%}
|
| 31 |
-
{%- for item in message['content'] -%}
|
| 32 |
-
{%- if item['type'] == 'image' -%}
|
| 33 |
-
{{ '<start_of_image>' }}
|
| 34 |
-
{%- elif item['type'] == 'text' -%}
|
| 35 |
-
{{ item['text'] | trim }}
|
| 36 |
-
{%- endif -%}
|
| 37 |
-
{%- endfor -%}
|
| 38 |
-
{%- else -%}
|
| 39 |
-
{{ raise_exception("Invalid content type") }}
|
| 40 |
-
{%- endif -%}
|
| 41 |
-
{{ '<end_of_turn>
|
| 42 |
-
' }}
|
| 43 |
-
{%- endfor -%}
|
| 44 |
-
{%- if add_generation_prompt -%}
|
| 45 |
-
{{'<start_of_turn>model
|
| 46 |
-
'}}
|
| 47 |
-
{%- endif -%}
|
|
|
|
| 1 |
+
{{ bos_token }}{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '
|
| 2 |
+
' + message['content'] | trim + '<end_of_turn>
|
| 3 |
+
' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model
|
| 4 |
+
'}}{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
special_tokens_map.json
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
|
|
|
|
|
|
|
|
|
| 3 |
"bos_token": {
|
| 4 |
"content": "<bos>",
|
| 5 |
"lstrip": false,
|
|
@@ -7,16 +10,14 @@
|
|
| 7 |
"rstrip": false,
|
| 8 |
"single_word": false
|
| 9 |
},
|
| 10 |
-
"eoi_token": "<end_of_image>",
|
| 11 |
"eos_token": {
|
| 12 |
-
"content": "<
|
| 13 |
"lstrip": false,
|
| 14 |
"normalized": false,
|
| 15 |
"rstrip": false,
|
| 16 |
"single_word": false
|
| 17 |
},
|
| 18 |
-
"
|
| 19 |
-
"pad_token": "<end_of_turn>",
|
| 20 |
"unk_token": {
|
| 21 |
"content": "<unk>",
|
| 22 |
"lstrip": false,
|
|
|
|
| 1 |
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<start_of_turn>",
|
| 4 |
+
"<end_of_turn>"
|
| 5 |
+
],
|
| 6 |
"bos_token": {
|
| 7 |
"content": "<bos>",
|
| 8 |
"lstrip": false,
|
|
|
|
| 10 |
"rstrip": false,
|
| 11 |
"single_word": false
|
| 12 |
},
|
|
|
|
| 13 |
"eos_token": {
|
| 14 |
+
"content": "<eos>",
|
| 15 |
"lstrip": false,
|
| 16 |
"normalized": false,
|
| 17 |
"rstrip": false,
|
| 18 |
"single_word": false
|
| 19 |
},
|
| 20 |
+
"pad_token": "<eos>",
|
|
|
|
| 21 |
"unk_token": {
|
| 22 |
"content": "<unk>",
|
| 23 |
"lstrip": false,
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b7eb818e7f83838615f7d3ca8b4f7690af124ce01dbf4870378d65aad732c22a
|
| 3 |
+
size 34356140
|
tokenizer.model
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61a7b147390c64585d6c3543dd6fc636906c9af3865a5548f27f31aee1d4c8e2
|
| 3 |
+
size 4241003
|
tokenizer_config.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|