Upload model trained with Unsloth
Browse filesUpload model trained with Unsloth 2x faster
- chat_template.jinja +47 -8
- special_tokens_map.json +31 -4
- tokenizer_config.json +16 -4
chat_template.jinja
CHANGED
|
@@ -1,8 +1,47 @@
|
|
| 1 |
-
{{ bos_token }}
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
'
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{ bos_token }}
|
| 2 |
+
{%- if messages[0]['role'] == 'system' -%}
|
| 3 |
+
{%- if messages[0]['content'] is string -%}
|
| 4 |
+
{%- set first_user_prefix = messages[0]['content'] + '
|
| 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 -%}
|
special_tokens_map.json
CHANGED
|
@@ -1,6 +1,33 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"boi_token": "<start_of_image>",
|
| 3 |
+
"bos_token": {
|
| 4 |
+
"content": "<bos>",
|
| 5 |
+
"lstrip": false,
|
| 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 |
}
|
tokenizer_config.json
CHANGED
|
@@ -51323,12 +51323,24 @@
|
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51331 |
"pad_token": "<pad>",
|
| 51332 |
-
"
|
| 51333 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51334 |
}
|
|
|
|
| 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 |
+
"boi_token": "<start_of_image>",
|
| 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 |
+
"padding_side": "left",
|
| 51340 |
+
"processor_class": "Gemma3Processor",
|
| 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 |
}
|