Upload model trained with Unsloth
Browse filesUpload model trained with Unsloth 2x faster
- chat_template.jinja +8 -47
- special_tokens_map.json +4 -31
- tokenizer_config.json +4 -16
chat_template.jinja
CHANGED
|
@@ -1,47 +1,8 @@
|
|
| 1 |
-
{{ bos_token }}
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
'
|
| 7 |
-
|
| 8 |
-
|
| 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' %}{{'<start_of_turn>user
|
| 2 |
+
' + messages[0]['content'] | trim + ' ' + messages[1]['content'] | trim + '<end_of_turn>
|
| 3 |
+
'}}{% set messages = messages[2:] %}{% endif %}{% for message in messages %}{% if message['role'] == 'user' %}{{'<start_of_turn>user
|
| 4 |
+
' + message['content'] | trim + '<end_of_turn>
|
| 5 |
+
'}}{% elif message['role'] == 'assistant' %}{{'<start_of_turn>model
|
| 6 |
+
' + message['content'] | trim + '<end_of_turn>
|
| 7 |
+
' }}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<start_of_turn>model
|
| 8 |
+
' }}{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
special_tokens_map.json
CHANGED
|
@@ -1,33 +1,6 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
"normalized": false,
|
| 7 |
-
"rstrip": false,
|
| 8 |
-
"single_word": false
|
| 9 |
-
},
|
| 10 |
-
"eoi_token": "<end_of_image>",
|
| 11 |
-
"eos_token": {
|
| 12 |
-
"content": "<end_of_turn>",
|
| 13 |
-
"lstrip": false,
|
| 14 |
-
"normalized": false,
|
| 15 |
-
"rstrip": false,
|
| 16 |
-
"single_word": false
|
| 17 |
-
},
|
| 18 |
-
"image_token": "<image_soft_token>",
|
| 19 |
-
"pad_token": {
|
| 20 |
-
"content": "<pad>",
|
| 21 |
-
"lstrip": false,
|
| 22 |
-
"normalized": false,
|
| 23 |
-
"rstrip": false,
|
| 24 |
-
"single_word": false
|
| 25 |
-
},
|
| 26 |
-
"unk_token": {
|
| 27 |
-
"content": "<unk>",
|
| 28 |
-
"lstrip": false,
|
| 29 |
-
"normalized": false,
|
| 30 |
-
"rstrip": false,
|
| 31 |
-
"single_word": false
|
| 32 |
-
}
|
| 33 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token": "<bos>",
|
| 3 |
+
"eos_token": "<end_of_turn>",
|
| 4 |
+
"pad_token": "<pad>",
|
| 5 |
+
"unk_token": "<unk>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
}
|
tokenizer_config.json
CHANGED
|
@@ -51323,24 +51323,12 @@
|
|
| 51323 |
"special": true
|
| 51324 |
}
|
| 51325 |
},
|
| 51326 |
-
"boi_token": "<start_of_image>",
|
| 51327 |
"bos_token": "<bos>",
|
| 51328 |
"clean_up_tokenization_spaces": false,
|
| 51329 |
-
"eoi_token": "<end_of_image>",
|
| 51330 |
"eos_token": "<end_of_turn>",
|
| 51331 |
-
"extra_special_tokens": {
|
| 51332 |
-
|
| 51333 |
-
"eoi_token": "<end_of_image>",
|
| 51334 |
-
"image_token": "<image_soft_token>"
|
| 51335 |
-
},
|
| 51336 |
-
"image_token": "<image_soft_token>",
|
| 51337 |
-
"model_max_length": 32768,
|
| 51338 |
"pad_token": "<pad>",
|
| 51339 |
-
"
|
| 51340 |
-
"
|
| 51341 |
-
"sp_model_kwargs": null,
|
| 51342 |
-
"spaces_between_special_tokens": false,
|
| 51343 |
-
"tokenizer_class": "GemmaTokenizer",
|
| 51344 |
-
"unk_token": "<unk>",
|
| 51345 |
-
"use_default_system_prompt": false
|
| 51346 |
}
|
|
|
|
| 51323 |
"special": true
|
| 51324 |
}
|
| 51325 |
},
|
|
|
|
| 51326 |
"bos_token": "<bos>",
|
| 51327 |
"clean_up_tokenization_spaces": false,
|
|
|
|
| 51328 |
"eos_token": "<end_of_turn>",
|
| 51329 |
+
"extra_special_tokens": {},
|
| 51330 |
+
"model_max_length": 1000000000000000019884624838656,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51331 |
"pad_token": "<pad>",
|
| 51332 |
+
"tokenizer_class": "GemmaTokenizerFast",
|
| 51333 |
+
"unk_token": "<unk>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51334 |
}
|