ATL-Machine commited on
Commit
f0e03cc
·
verified ·
1 Parent(s): e3ef4d3

Upload model (bfloat16) from script

Browse files
chat_template.jinja CHANGED
@@ -14,6 +14,14 @@
14
  {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
  {%- endif %}
16
  {%- endif %}
 
 
 
 
 
 
 
 
17
  {%- for message in messages %}
18
  {%- if message.content is string %}
19
  {%- set content = message.content %}
@@ -23,7 +31,25 @@
23
  {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
24
  {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
25
  {%- elif message.role == "assistant" %}
26
- {{- '<|im_start|>' + message.role + '\n' + content }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  {%- if message.tool_calls %}
28
  {%- for tool_call in message.tool_calls %}
29
  {%- if (loop.first and content) or (not loop.first) %}
@@ -44,6 +70,7 @@
44
  {%- endfor %}
45
  {%- endif %}
46
  {{- '<|im_end|>\n' }}
 
47
  {%- elif message.role == "tool" %}
48
  {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
49
  {{- '<|im_start|>user' }}
@@ -57,5 +84,5 @@
57
  {%- endif %}
58
  {%- endfor %}
59
  {%- if add_generation_prompt %}
60
- {{- '<|im_start|>assistant\n' }}
61
  {%- endif %}
 
14
  {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
  {%- endif %}
16
  {%- endif %}
17
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
18
+ {%- for message in messages[::-1] %}
19
+ {%- set index = (messages|length - 1) - loop.index0 %}
20
+ {%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
21
+ {%- set ns.multi_step_tool = false %}
22
+ {%- set ns.last_query_index = index %}
23
+ {%- endif %}
24
+ {%- endfor %}
25
  {%- for message in messages %}
26
  {%- if message.content is string %}
27
  {%- set content = message.content %}
 
31
  {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
32
  {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
33
  {%- elif message.role == "assistant" %}
34
+ {%- set reasoning_content = '' %}
35
+ {%- if message.reasoning_content is string %}
36
+ {%- set reasoning_content = message.reasoning_content %}
37
+ {%- else %}
38
+ {%- if '</think>' in content %}
39
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
40
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
41
+ {%- endif %}
42
+ {%- endif %}
43
+ {%- generation -%}
44
+ {%- if loop.index0 > ns.last_query_index %}
45
+ {%- if loop.last or (not loop.last and reasoning_content) %}
46
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
47
+ {%- else %}
48
+ {{- '<|im_start|>' + message.role + '\n' + content }}
49
+ {%- endif %}
50
+ {%- else %}
51
+ {{- '<|im_start|>' + message.role + '\n' + content }}
52
+ {%- endif %}
53
  {%- if message.tool_calls %}
54
  {%- for tool_call in message.tool_calls %}
55
  {%- if (loop.first and content) or (not loop.first) %}
 
70
  {%- endfor %}
71
  {%- endif %}
72
  {{- '<|im_end|>\n' }}
73
+ {%- endgeneration -%}
74
  {%- elif message.role == "tool" %}
75
  {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
76
  {{- '<|im_start|>user' }}
 
84
  {%- endif %}
85
  {%- endfor %}
86
  {%- if add_generation_prompt %}
87
+ {{- '<|im_start|>assistant\n<think>\n' }}
88
  {%- endif %}
config.json CHANGED
@@ -61,8 +61,8 @@
61
  "rope_theta": 5000000,
62
  "sliding_window": null,
63
  "tie_word_embeddings": true,
64
- "transformers_version": "4.57.3",
65
- "unsloth_version": "2026.1.2",
66
  "use_cache": false,
67
  "use_sliding_window": false,
68
  "vocab_size": 151936
 
61
  "rope_theta": 5000000,
62
  "sliding_window": null,
63
  "tie_word_embeddings": true,
64
+ "transformers_version": "4.56.2",
65
+ "unsloth_version": "2025.12.10",
66
  "use_cache": false,
67
  "use_sliding_window": false,
68
  "vocab_size": 151936
model-00001-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ce6006507e7b1d3a8f8a7f0ab19e5cea144bf5767ffaa755740b5a811e6e0bc4
3
- size 4967215544
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60fbe507733e11381b95f73f9b27cfa1be264a8bb36baacbe4bddd1e54a86d96
3
+ size 4967215455
model-00002-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b5d21e8b937a58f1052266d64bb047940372ec4bd8113f63649fd6923a9e6c8d
3
- size 3855679328
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de14d77cf28c73c724f4214aaae93f0c0fee3bc7bd7e7673de63e71ea34ddf76
3
+ size 3077766730
model.safetensors.index.json CHANGED
@@ -1,10 +1,9 @@
1
  {
2
  "metadata": {
3
  "total_parameters": 4022468096,
4
- "total_size": 8822848512
5
  },
6
  "weight_map": {
7
- "lm_head.weight": "model-00002-of-00002.safetensors",
8
  "model.embed_tokens.weight": "model-00001-of-00002.safetensors",
9
  "model.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
10
  "model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
 
1
  {
2
  "metadata": {
3
  "total_parameters": 4022468096,
4
+ "total_size": 8044936192
5
  },
6
  "weight_map": {
 
7
  "model.embed_tokens.weight": "model-00001-of-00002.safetensors",
8
  "model.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
9
  "model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
tokenizer_config.json CHANGED
@@ -231,10 +231,10 @@
231
  "eos_token": "<|im_end|>",
232
  "errors": "replace",
233
  "extra_special_tokens": {},
234
- "model_max_length": 1010000,
235
  "pad_token": "<|endoftext|>",
236
  "split_special_tokens": false,
237
  "tokenizer_class": "Qwen2Tokenizer",
238
  "unk_token": null,
239
- "chat_template": "{%- 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{%- 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 {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\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 {{- 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{%- endif %}"
240
  }
 
231
  "eos_token": "<|im_end|>",
232
  "errors": "replace",
233
  "extra_special_tokens": {},
234
+ "model_max_length": 262144,
235
  "pad_token": "<|endoftext|>",
236
  "split_special_tokens": false,
237
  "tokenizer_class": "Qwen2Tokenizer",
238
  "unk_token": null,
239
+ "chat_template": "{%- 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 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_response>') and message.content.endswith('</tool_response>')) %}\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 {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- generation -%}\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 {%- endgeneration -%}\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 {{- 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<think>\\n' }}\n{%- endif %}"
240
  }