Upload folder using huggingface_hub
Browse files- chat_template.jinja +2 -4
- generation_config.json +10 -0
- special_tokens_map.json +1 -1
- tokenizer.json +1 -1
- tokenizer_config.json +4 -6
chat_template.jinja
CHANGED
|
@@ -97,8 +97,6 @@ think_mode=True
|
|
| 97 |
{%- endif %}
|
| 98 |
{%- endif %}
|
| 99 |
{%- endfor %}
|
| 100 |
-
{
|
| 101 |
-
{{- "<|im_start|>assistant
|
| 102 |
<think>
|
| 103 |
-
"}}
|
| 104 |
-
{%- endif %}
|
|
|
|
| 97 |
{%- endif %}
|
| 98 |
{%- endif %}
|
| 99 |
{%- endfor %}
|
| 100 |
+
{{- "<|im_start|>assistant
|
|
|
|
| 101 |
<think>
|
| 102 |
+
"}}
|
|
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"top_p": 0.95,
|
| 3 |
+
"temperature": 0.6,
|
| 4 |
+
"bos_token_id": 1,
|
| 5 |
+
"eos_token_id": 2,
|
| 6 |
+
"pad_token_id": 0,
|
| 7 |
+
"repetition_penalty": 1.0,
|
| 8 |
+
"frequency_penalty": 0.0,
|
| 9 |
+
"presence_penalty": 0.0
|
| 10 |
+
}
|
special_tokens_map.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
"eos_token": {
|
| 17 |
-
"content": "
|
| 18 |
"lstrip": false,
|
| 19 |
"normalized": false,
|
| 20 |
"rstrip": false,
|
|
|
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
"eos_token": {
|
| 17 |
+
"content": "<think>",
|
| 18 |
"lstrip": false,
|
| 19 |
"normalized": false,
|
| 20 |
"rstrip": false,
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 10999540
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:99c25a6ebd867c54435ca2fdb8fdd3187699aea9bd85d83b6d43f50ebedb4564
|
| 3 |
size 10999540
|
tokenizer_config.json
CHANGED
|
@@ -137,7 +137,7 @@
|
|
| 137 |
"normalized": false,
|
| 138 |
"rstrip": false,
|
| 139 |
"single_word": false,
|
| 140 |
-
"special":
|
| 141 |
},
|
| 142 |
"100282": {
|
| 143 |
"content": "</think>",
|
|
@@ -257,14 +257,14 @@
|
|
| 257 |
"normalized": false,
|
| 258 |
"rstrip": false,
|
| 259 |
"single_word": false,
|
| 260 |
-
"special":
|
| 261 |
}
|
| 262 |
},
|
| 263 |
"additional_special_tokens": [],
|
| 264 |
"bos_token": "<s>",
|
| 265 |
"clean_up_tokenization_spaces": false,
|
| 266 |
"cls_token": "<|begin_of_sentence|>",
|
| 267 |
-
"eos_token": "
|
| 268 |
"extra_special_tokens": {},
|
| 269 |
"header_end_token": "<mask:7>",
|
| 270 |
"header_start_token": "<mask:6>",
|
|
@@ -274,12 +274,10 @@
|
|
| 274 |
"pad_token": "<unk>",
|
| 275 |
"padding_side": "left",
|
| 276 |
"sep_token": "<|end_of_sentence|>",
|
| 277 |
-
"sp_model_kwargs": {},
|
| 278 |
-
"spaces_between_special_tokens": false,
|
| 279 |
"sys_end_token": "<mask:5>",
|
| 280 |
"sys_start_token": "<mask:4>",
|
| 281 |
"tokenizer_class": "LlamaTokenizer",
|
| 282 |
"unk_token": "<unk>",
|
| 283 |
"use_default_system_prompt": false,
|
| 284 |
-
"chat_template": "{{- '<|im_start|>system\n' }}{%- if messages[0].role != 'system' and not system_settings %}{{- '<global_setting>\nthink_mode=True\n</global_setting>' }}{%- else%}{{- '<system_setting>\n' }}{{- system_settings + '\n' if system_settings else '' }}{{- (messages[0].content + '\n' if messages[0].role == 'system' else '') + '</system_setting>\n\n<global_setting>\nthink_mode=True\n</global_setting>' }}{%- endif %}{%- if tools %}{{- \"\n\n<tool_list>\" }}{{- '\n' }}{{-'['}}{% for tool in tools %}{{'{\"type\": \"function\", \"function\": '}}{{-(tool.function | tojson)}}}{%-if not loop.last%},{%- endif %}{%endfor%}{{-']'}}{{- \"\n</tool_list>\" }}{%- endif %}{{-'<|im_end|>\n\n' }}{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_output>') and message.content.endswith('</tool_output>')) %}\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.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.thoughts is string %}\n {%- set reasoning_content = message.thoughts %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = (content.split('</think>')|first).rstrip('\n').split('<think>')[-1].lstrip('\n') %}\n {%- set content = (content.split('</think>')|last).lstrip('\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index and (loop.last or (not loop.last and reasoning_content)) %} {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n' }} {%- else %} {{- '<|im_start|>' + message.role + '\n' }} {%- endif %} {%- if content|length > 0 %} {{- '<response>\n' + content + '\n</response>\n' }} {%- endif %} {%- 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 {{- '\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' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\n\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>tool' }}\n {%- endif %}\n {{- '\n<tool_output>' }}\n {{- message.content|tojson }}\n {{- '</tool_output>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\n\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n {
|
| 285 |
}
|
|
|
|
| 137 |
"normalized": false,
|
| 138 |
"rstrip": false,
|
| 139 |
"single_word": false,
|
| 140 |
+
"special": true
|
| 141 |
},
|
| 142 |
"100282": {
|
| 143 |
"content": "</think>",
|
|
|
|
| 257 |
"normalized": false,
|
| 258 |
"rstrip": false,
|
| 259 |
"single_word": false,
|
| 260 |
+
"special": false
|
| 261 |
}
|
| 262 |
},
|
| 263 |
"additional_special_tokens": [],
|
| 264 |
"bos_token": "<s>",
|
| 265 |
"clean_up_tokenization_spaces": false,
|
| 266 |
"cls_token": "<|begin_of_sentence|>",
|
| 267 |
+
"eos_token": "<think>",
|
| 268 |
"extra_special_tokens": {},
|
| 269 |
"header_end_token": "<mask:7>",
|
| 270 |
"header_start_token": "<mask:6>",
|
|
|
|
| 274 |
"pad_token": "<unk>",
|
| 275 |
"padding_side": "left",
|
| 276 |
"sep_token": "<|end_of_sentence|>",
|
|
|
|
|
|
|
| 277 |
"sys_end_token": "<mask:5>",
|
| 278 |
"sys_start_token": "<mask:4>",
|
| 279 |
"tokenizer_class": "LlamaTokenizer",
|
| 280 |
"unk_token": "<unk>",
|
| 281 |
"use_default_system_prompt": false,
|
| 282 |
+
"chat_template": "{{- '<|im_start|>system\n' }}{%- if messages[0].role != 'system' and not system_settings %}{{- '<global_setting>\nthink_mode=True\n</global_setting>' }}{%- else%}{{- '<system_setting>\n' }}{{- system_settings + '\n' if system_settings else '' }}{{- (messages[0].content + '\n' if messages[0].role == 'system' else '') + '</system_setting>\n\n<global_setting>\nthink_mode=True\n</global_setting>' }}{%- endif %}{%- if tools %}{{- \"\n\n<tool_list>\" }}{{- '\n' }}{{-'['}}{% for tool in tools %}{{'{\"type\": \"function\", \"function\": '}}{{-(tool.function | tojson)}}}{%-if not loop.last%},{%- endif %}{%endfor%}{{-']'}}{{- \"\n</tool_list>\" }}{%- endif %}{{-'<|im_end|>\n\n' }}{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_output>') and message.content.endswith('</tool_output>')) %}\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.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.thoughts is string %}\n {%- set reasoning_content = message.thoughts %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = (content.split('</think>')|first).rstrip('\n').split('<think>')[-1].lstrip('\n') %}\n {%- set content = (content.split('</think>')|last).lstrip('\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index and (loop.last or (not loop.last and reasoning_content)) %} {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n' }} {%- else %} {{- '<|im_start|>' + message.role + '\n' }} {%- endif %} {%- if content|length > 0 %} {{- '<response>\n' + content + '\n</response>\n' }} {%- endif %} {%- 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 {{- '\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' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\n\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>tool' }}\n {%- endif %}\n {{- '\n<tool_output>' }}\n {{- message.content|tojson }}\n {{- '</tool_output>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\n\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n {{- \"<|im_start|>assistant\n<think>\n\"}}"
|
| 283 |
}
|