(Trained with Unsloth)
Browse files- chat_template.jinja +140 -5
- config.json +109 -37
- special_tokens_map.json +1 -8
- tokenizer.json +2 -2
- tokenizer_config.json +23 -23
chat_template.jinja
CHANGED
|
@@ -1,9 +1,144 @@
|
|
| 1 |
-
{{ bos_token }}{% for message in messages %}{% if message['role'] == 'user' %}{{ '<|start_header_id|>user<|end_header_id|>
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
'
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
+
{%- if tools %}
|
| 3 |
+
{{- '<|im_start|>system
|
| 4 |
+
' }}
|
| 5 |
+
{%- if messages[0].role == 'system' %}
|
| 6 |
+
{{- messages[0].content + '
|
| 7 |
|
| 8 |
+
' }}
|
| 9 |
+
{%- endif %}
|
| 10 |
+
{{- "# Tools
|
| 11 |
|
| 12 |
+
You may call one or more functions to assist with the user query.
|
| 13 |
|
| 14 |
+
You are provided with function signatures within <tools></tools> XML tags:
|
| 15 |
+
<tools>" }}
|
| 16 |
+
{%- for tool in tools %}
|
| 17 |
+
{{- "
|
| 18 |
+
" }}
|
| 19 |
+
{{- tool | tojson }}
|
| 20 |
+
{%- endfor %}
|
| 21 |
+
{{- "
|
| 22 |
+
</tools>
|
| 23 |
+
|
| 24 |
+
For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
|
| 25 |
+
<tool_call>
|
| 26 |
+
{\"name\": <function-name>, \"arguments\": <args-json-object>}
|
| 27 |
+
</tool_call><|im_end|>
|
| 28 |
+
" }}
|
| 29 |
+
{%- else %}
|
| 30 |
+
{%- if messages[0].role == 'system' %}
|
| 31 |
+
{{- '<|im_start|>system
|
| 32 |
+
' + messages[0].content + '<|im_end|>
|
| 33 |
+
' }}
|
| 34 |
+
{%- endif %}
|
| 35 |
+
{%- endif %}
|
| 36 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 37 |
+
{%- for forward_message in messages %}
|
| 38 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 39 |
+
{%- set message = messages[index] %}
|
| 40 |
+
{%- set current_content = message.content if message.content is not none else '' %}
|
| 41 |
+
{%- set tool_start = '<tool_response>' %}
|
| 42 |
+
{%- set tool_start_length = tool_start|length %}
|
| 43 |
+
{%- set start_of_message = current_content[:tool_start_length] %}
|
| 44 |
+
{%- set tool_end = '</tool_response>' %}
|
| 45 |
+
{%- set tool_end_length = tool_end|length %}
|
| 46 |
+
{%- set start_pos = (current_content|length) - tool_end_length %}
|
| 47 |
+
{%- if start_pos < 0 %}
|
| 48 |
+
{%- set start_pos = 0 %}
|
| 49 |
+
{%- endif %}
|
| 50 |
+
{%- set end_of_message = current_content[start_pos:] %}
|
| 51 |
+
{%- if ns.multi_step_tool and message.role == "user" and not(start_of_message == tool_start and end_of_message == tool_end) %}
|
| 52 |
+
{%- set ns.multi_step_tool = false %}
|
| 53 |
+
{%- set ns.last_query_index = index %}
|
| 54 |
+
{%- endif %}
|
| 55 |
+
{%- endfor %}
|
| 56 |
+
{%- for message in messages %}
|
| 57 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 58 |
+
{{- '<|im_start|>' + message.role + '
|
| 59 |
+
' + message.content + '<|im_end|>' + '
|
| 60 |
+
' }}
|
| 61 |
+
{%- elif message.role == "assistant" %}
|
| 62 |
+
{%- set content = message.content %}
|
| 63 |
+
{%- set reasoning_content = '' %}
|
| 64 |
+
{%- if message.reasoning_content is defined and message.reasoning_content is not none %}
|
| 65 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 66 |
+
{%- else %}
|
| 67 |
+
{%- if '</think>' in message.content %}
|
| 68 |
+
{%- set content = (message.content.split('</think>')|last).lstrip('
|
| 69 |
+
') %}
|
| 70 |
+
{%- set reasoning_content = (message.content.split('</think>')|first).rstrip('
|
| 71 |
+
') %}
|
| 72 |
+
{%- set reasoning_content = (reasoning_content.split('<think>')|last).lstrip('
|
| 73 |
+
') %}
|
| 74 |
+
{%- endif %}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 77 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 78 |
+
{{- '<|im_start|>' + message.role + '
|
| 79 |
+
<think>
|
| 80 |
+
' + reasoning_content.strip('
|
| 81 |
+
') + '
|
| 82 |
+
</think>
|
| 83 |
+
|
| 84 |
+
' + content.lstrip('
|
| 85 |
+
') }}
|
| 86 |
+
{%- else %}
|
| 87 |
+
{{- '<|im_start|>' + message.role + '
|
| 88 |
+
' + content }}
|
| 89 |
+
{%- endif %}
|
| 90 |
+
{%- else %}
|
| 91 |
+
{{- '<|im_start|>' + message.role + '
|
| 92 |
+
' + content }}
|
| 93 |
+
{%- endif %}
|
| 94 |
+
{%- if message.tool_calls %}
|
| 95 |
+
{%- for tool_call in message.tool_calls %}
|
| 96 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 97 |
+
{{- '
|
| 98 |
+
' }}
|
| 99 |
+
{%- endif %}
|
| 100 |
+
{%- if tool_call.function %}
|
| 101 |
+
{%- set tool_call = tool_call.function %}
|
| 102 |
+
{%- endif %}
|
| 103 |
+
{{- '<tool_call>
|
| 104 |
+
{"name": "' }}
|
| 105 |
+
{{- tool_call.name }}
|
| 106 |
+
{{- '", "arguments": ' }}
|
| 107 |
+
{%- if tool_call.arguments is string %}
|
| 108 |
+
{{- tool_call.arguments }}
|
| 109 |
+
{%- else %}
|
| 110 |
+
{{- tool_call.arguments | tojson }}
|
| 111 |
+
{%- endif %}
|
| 112 |
+
{{- '}
|
| 113 |
+
</tool_call>' }}
|
| 114 |
+
{%- endfor %}
|
| 115 |
+
{%- endif %}
|
| 116 |
+
{{- '<|im_end|>
|
| 117 |
+
' }}
|
| 118 |
+
{%- elif message.role == "tool" %}
|
| 119 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 120 |
+
{{- '<|im_start|>user' }}
|
| 121 |
+
{%- endif %}
|
| 122 |
+
{{- '
|
| 123 |
+
<tool_response>
|
| 124 |
+
' }}
|
| 125 |
+
{{- message.content }}
|
| 126 |
+
{{- '
|
| 127 |
+
</tool_response>' }}
|
| 128 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 129 |
+
{{- '<|im_end|>
|
| 130 |
+
' }}
|
| 131 |
+
{%- endif %}
|
| 132 |
+
{%- endif %}
|
| 133 |
+
{%- endfor %}
|
| 134 |
+
{%- if add_generation_prompt %}
|
| 135 |
+
{{- '<|im_start|>assistant
|
| 136 |
+
' }}
|
| 137 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 138 |
+
{{- '<think>
|
| 139 |
+
|
| 140 |
+
</think>
|
| 141 |
+
|
| 142 |
+
' }}
|
| 143 |
+
{%- endif %}
|
| 144 |
+
{%- endif %}
|
config.json
CHANGED
|
@@ -1,38 +1,110 @@
|
|
| 1 |
{
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
"
|
| 16 |
-
"
|
| 17 |
-
"
|
| 18 |
-
"
|
| 19 |
-
"
|
| 20 |
-
"
|
| 21 |
-
"
|
| 22 |
-
"
|
| 23 |
-
"
|
| 24 |
-
"
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
"
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"
|
| 37 |
-
"
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"SmolLM3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"torch_dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 128012,
|
| 10 |
+
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 2048,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 11008,
|
| 14 |
+
"layer_types": [
|
| 15 |
+
"full_attention",
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"full_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"full_attention"
|
| 51 |
+
],
|
| 52 |
+
"max_position_embeddings": 65536,
|
| 53 |
+
"max_window_layers": 28,
|
| 54 |
+
"mlp_bias": false,
|
| 55 |
+
"model_type": "smollm3",
|
| 56 |
+
"no_rope_layer_interval": 4,
|
| 57 |
+
"no_rope_layers": [
|
| 58 |
+
1,
|
| 59 |
+
1,
|
| 60 |
+
1,
|
| 61 |
+
0,
|
| 62 |
+
1,
|
| 63 |
+
1,
|
| 64 |
+
1,
|
| 65 |
+
0,
|
| 66 |
+
1,
|
| 67 |
+
1,
|
| 68 |
+
1,
|
| 69 |
+
0,
|
| 70 |
+
1,
|
| 71 |
+
1,
|
| 72 |
+
1,
|
| 73 |
+
0,
|
| 74 |
+
1,
|
| 75 |
+
1,
|
| 76 |
+
1,
|
| 77 |
+
0,
|
| 78 |
+
1,
|
| 79 |
+
1,
|
| 80 |
+
1,
|
| 81 |
+
0,
|
| 82 |
+
1,
|
| 83 |
+
1,
|
| 84 |
+
1,
|
| 85 |
+
0,
|
| 86 |
+
1,
|
| 87 |
+
1,
|
| 88 |
+
1,
|
| 89 |
+
0,
|
| 90 |
+
1,
|
| 91 |
+
1,
|
| 92 |
+
1,
|
| 93 |
+
0
|
| 94 |
+
],
|
| 95 |
+
"num_attention_heads": 16,
|
| 96 |
+
"num_hidden_layers": 36,
|
| 97 |
+
"num_key_value_heads": 4,
|
| 98 |
+
"pad_token_id": 128004,
|
| 99 |
+
"pretraining_tp": 1,
|
| 100 |
+
"rms_norm_eps": 1e-06,
|
| 101 |
+
"rope_scaling": null,
|
| 102 |
+
"rope_theta": 5000000.0,
|
| 103 |
+
"sliding_window": null,
|
| 104 |
+
"transformers_version": "4.57.3",
|
| 105 |
+
"unsloth_fixed": true,
|
| 106 |
+
"unsloth_version": "2025.12.1",
|
| 107 |
+
"use_cache": false,
|
| 108 |
+
"use_sliding_window": false,
|
| 109 |
+
"vocab_size": 128256
|
| 110 |
+
}
|
special_tokens_map.json
CHANGED
|
@@ -1,13 +1,6 @@
|
|
| 1 |
{
|
| 2 |
-
"bos_token": {
|
| 3 |
-
"content": "<|begin_of_text|>",
|
| 4 |
-
"lstrip": false,
|
| 5 |
-
"normalized": false,
|
| 6 |
-
"rstrip": false,
|
| 7 |
-
"single_word": false
|
| 8 |
-
},
|
| 9 |
"eos_token": {
|
| 10 |
-
"content": "<|
|
| 11 |
"lstrip": false,
|
| 12 |
"normalized": false,
|
| 13 |
"rstrip": false,
|
|
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
"eos_token": {
|
| 3 |
+
"content": "<|im_end|>",
|
| 4 |
"lstrip": false,
|
| 5 |
"normalized": false,
|
| 6 |
"rstrip": 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:a3404b7373db3e9b7a971972d3cc202ff4960fdb83d86209f608d55ff8a73f4d
|
| 3 |
+
size 17209097
|
tokenizer_config.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"add_bos_token": true,
|
| 3 |
"added_tokens_decoder": {
|
| 4 |
"128000": {
|
| 5 |
"content": "<|begin_of_text|>",
|
|
@@ -18,20 +17,20 @@
|
|
| 18 |
"special": true
|
| 19 |
},
|
| 20 |
"128002": {
|
| 21 |
-
"content": "<
|
| 22 |
"lstrip": false,
|
| 23 |
"normalized": false,
|
| 24 |
"rstrip": false,
|
| 25 |
"single_word": false,
|
| 26 |
-
"special":
|
| 27 |
},
|
| 28 |
"128003": {
|
| 29 |
-
"content": "<
|
| 30 |
"lstrip": false,
|
| 31 |
"normalized": false,
|
| 32 |
"rstrip": false,
|
| 33 |
"single_word": false,
|
| 34 |
-
"special":
|
| 35 |
},
|
| 36 |
"128004": {
|
| 37 |
"content": "<|finetune_right_pad_id|>",
|
|
@@ -90,7 +89,7 @@
|
|
| 90 |
"special": true
|
| 91 |
},
|
| 92 |
"128011": {
|
| 93 |
-
"content": "<|
|
| 94 |
"lstrip": false,
|
| 95 |
"normalized": false,
|
| 96 |
"rstrip": false,
|
|
@@ -98,7 +97,7 @@
|
|
| 98 |
"special": true
|
| 99 |
},
|
| 100 |
"128012": {
|
| 101 |
-
"content": "<|
|
| 102 |
"lstrip": false,
|
| 103 |
"normalized": false,
|
| 104 |
"rstrip": false,
|
|
@@ -106,52 +105,52 @@
|
|
| 106 |
"special": true
|
| 107 |
},
|
| 108 |
"128013": {
|
| 109 |
-
"content": "<
|
| 110 |
"lstrip": false,
|
| 111 |
"normalized": false,
|
| 112 |
"rstrip": false,
|
| 113 |
"single_word": false,
|
| 114 |
-
"special":
|
| 115 |
},
|
| 116 |
"128014": {
|
| 117 |
-
"content": "<
|
| 118 |
"lstrip": false,
|
| 119 |
"normalized": false,
|
| 120 |
"rstrip": false,
|
| 121 |
"single_word": false,
|
| 122 |
-
"special":
|
| 123 |
},
|
| 124 |
"128015": {
|
| 125 |
-
"content": "<
|
| 126 |
"lstrip": false,
|
| 127 |
"normalized": false,
|
| 128 |
"rstrip": false,
|
| 129 |
"single_word": false,
|
| 130 |
-
"special":
|
| 131 |
},
|
| 132 |
"128016": {
|
| 133 |
-
"content": "<
|
| 134 |
"lstrip": false,
|
| 135 |
"normalized": false,
|
| 136 |
"rstrip": false,
|
| 137 |
"single_word": false,
|
| 138 |
-
"special":
|
| 139 |
},
|
| 140 |
"128017": {
|
| 141 |
-
"content": "<
|
| 142 |
"lstrip": false,
|
| 143 |
"normalized": false,
|
| 144 |
"rstrip": false,
|
| 145 |
"single_word": false,
|
| 146 |
-
"special":
|
| 147 |
},
|
| 148 |
"128018": {
|
| 149 |
-
"content": "<
|
| 150 |
"lstrip": false,
|
| 151 |
"normalized": false,
|
| 152 |
"rstrip": false,
|
| 153 |
"single_word": false,
|
| 154 |
-
"special":
|
| 155 |
},
|
| 156 |
"128019": {
|
| 157 |
"content": "<|reserved_special_token_11|>",
|
|
@@ -2050,18 +2049,19 @@
|
|
| 2050 |
"special": true
|
| 2051 |
}
|
| 2052 |
},
|
| 2053 |
-
"bos_token":
|
| 2054 |
"clean_up_tokenization_spaces": true,
|
| 2055 |
-
"eos_token": "<|
|
| 2056 |
"extra_special_tokens": {},
|
|
|
|
| 2057 |
"model_input_names": [
|
| 2058 |
"input_ids",
|
| 2059 |
"attention_mask"
|
| 2060 |
],
|
| 2061 |
-
"model_max_length":
|
| 2062 |
"pad_token": "<|finetune_right_pad_id|>",
|
| 2063 |
"padding_side": "left",
|
| 2064 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 2065 |
"unk_token": null,
|
| 2066 |
-
"chat_template": "{{
|
| 2067 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"added_tokens_decoder": {
|
| 3 |
"128000": {
|
| 4 |
"content": "<|begin_of_text|>",
|
|
|
|
| 17 |
"special": true
|
| 18 |
},
|
| 19 |
"128002": {
|
| 20 |
+
"content": "<think>",
|
| 21 |
"lstrip": false,
|
| 22 |
"normalized": false,
|
| 23 |
"rstrip": false,
|
| 24 |
"single_word": false,
|
| 25 |
+
"special": false
|
| 26 |
},
|
| 27 |
"128003": {
|
| 28 |
+
"content": "</think>",
|
| 29 |
"lstrip": false,
|
| 30 |
"normalized": false,
|
| 31 |
"rstrip": false,
|
| 32 |
"single_word": false,
|
| 33 |
+
"special": false
|
| 34 |
},
|
| 35 |
"128004": {
|
| 36 |
"content": "<|finetune_right_pad_id|>",
|
|
|
|
| 89 |
"special": true
|
| 90 |
},
|
| 91 |
"128011": {
|
| 92 |
+
"content": "<|im_start|>",
|
| 93 |
"lstrip": false,
|
| 94 |
"normalized": false,
|
| 95 |
"rstrip": false,
|
|
|
|
| 97 |
"special": true
|
| 98 |
},
|
| 99 |
"128012": {
|
| 100 |
+
"content": "<|im_end|>",
|
| 101 |
"lstrip": false,
|
| 102 |
"normalized": false,
|
| 103 |
"rstrip": false,
|
|
|
|
| 105 |
"special": true
|
| 106 |
},
|
| 107 |
"128013": {
|
| 108 |
+
"content": "<tool_response>",
|
| 109 |
"lstrip": false,
|
| 110 |
"normalized": false,
|
| 111 |
"rstrip": false,
|
| 112 |
"single_word": false,
|
| 113 |
+
"special": false
|
| 114 |
},
|
| 115 |
"128014": {
|
| 116 |
+
"content": "</tool_response>",
|
| 117 |
"lstrip": false,
|
| 118 |
"normalized": false,
|
| 119 |
"rstrip": false,
|
| 120 |
"single_word": false,
|
| 121 |
+
"special": false
|
| 122 |
},
|
| 123 |
"128015": {
|
| 124 |
+
"content": "<tool_call>",
|
| 125 |
"lstrip": false,
|
| 126 |
"normalized": false,
|
| 127 |
"rstrip": false,
|
| 128 |
"single_word": false,
|
| 129 |
+
"special": false
|
| 130 |
},
|
| 131 |
"128016": {
|
| 132 |
+
"content": "</tool_call>",
|
| 133 |
"lstrip": false,
|
| 134 |
"normalized": false,
|
| 135 |
"rstrip": false,
|
| 136 |
"single_word": false,
|
| 137 |
+
"special": false
|
| 138 |
},
|
| 139 |
"128017": {
|
| 140 |
+
"content": "<code>",
|
| 141 |
"lstrip": false,
|
| 142 |
"normalized": false,
|
| 143 |
"rstrip": false,
|
| 144 |
"single_word": false,
|
| 145 |
+
"special": false
|
| 146 |
},
|
| 147 |
"128018": {
|
| 148 |
+
"content": "</code>",
|
| 149 |
"lstrip": false,
|
| 150 |
"normalized": false,
|
| 151 |
"rstrip": false,
|
| 152 |
"single_word": false,
|
| 153 |
+
"special": false
|
| 154 |
},
|
| 155 |
"128019": {
|
| 156 |
"content": "<|reserved_special_token_11|>",
|
|
|
|
| 2049 |
"special": true
|
| 2050 |
}
|
| 2051 |
},
|
| 2052 |
+
"bos_token": null,
|
| 2053 |
"clean_up_tokenization_spaces": true,
|
| 2054 |
+
"eos_token": "<|im_end|>",
|
| 2055 |
"extra_special_tokens": {},
|
| 2056 |
+
"fast": false,
|
| 2057 |
"model_input_names": [
|
| 2058 |
"input_ids",
|
| 2059 |
"attention_mask"
|
| 2060 |
],
|
| 2061 |
+
"model_max_length": 65536,
|
| 2062 |
"pad_token": "<|finetune_right_pad_id|>",
|
| 2063 |
"padding_side": "left",
|
| 2064 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 2065 |
"unk_token": null,
|
| 2066 |
+
"chat_template": "\n{%- if tools %}\n {{- '<|im_start|>system\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\n\n' }}\n {%- endif %}\n {{- \"# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\n</tool_call><|im_end|>\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for forward_message in messages %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- set message = messages[index] %}\n {%- set current_content = message.content if message.content is not none else '' %}\n {%- set tool_start = '<tool_response>' %}\n {%- set tool_start_length = tool_start|length %}\n {%- set start_of_message = current_content[:tool_start_length] %}\n {%- set tool_end = '</tool_response>' %}\n {%- set tool_end_length = tool_end|length %}\n {%- set start_pos = (current_content|length) - tool_end_length %}\n {%- if start_pos < 0 %}\n {%- set start_pos = 0 %}\n {%- endif %}\n {%- set end_of_message = current_content[start_pos:] %}\n {%- if ns.multi_step_tool and message.role == \"user\" and not(start_of_message == tool_start and end_of_message == tool_end) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set content = message.content %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is defined and message.reasoning_content is not none %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in message.content %}\n {%- set content = (message.content.split('</think>')|last).lstrip('\n') %}\n {%- set reasoning_content = (message.content.split('</think>')|first).rstrip('\n') %}\n {%- set reasoning_content = (reasoning_content.split('<think>')|last).lstrip('\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\n<tool_response>\n' }}\n {{- message.content }}\n {{- '\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\n\n</think>\n\n' }}\n {%- endif %}\n{%- endif %}\n"
|
| 2067 |
}
|