ATL-Machine commited on
Commit
9e6df3a
·
verified ·
1 Parent(s): e5b87f6

Upload model (bfloat16) from script

Browse files
chat_template.jinja CHANGED
@@ -14,36 +14,40 @@
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, thinking=false) %}
18
- {%- for message in messages[::-1] %}
19
- {%- if message.role == "system" and message.content and message.content | trim != "" %}
20
- {%- set ns.thinking = true %}
21
- {%- endif %}
22
  {%- set index = (messages|length - 1) - loop.index0 %}
23
- {%- 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>')) %}
 
 
 
 
 
 
 
 
 
 
 
24
  {%- set ns.multi_step_tool = false %}
25
  {%- set ns.last_query_index = index %}
26
  {%- endif %}
27
  {%- endfor %}
28
  {%- for message in messages %}
29
- {%- if message.content is string %}
30
- {%- set content = message.content %}
31
- {%- else %}
32
- {%- set content = '' %}
33
- {%- endif %}
34
  {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
35
- {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
36
  {%- elif message.role == "assistant" %}
 
37
  {%- set reasoning_content = '' %}
38
- {%- if message.reasoning_content is string %}
39
  {%- set reasoning_content = message.reasoning_content %}
40
  {%- else %}
41
- {%- if '</think>' in content %}
42
- {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
43
- {%- set content = content.split('</think>')[-1].lstrip('\n') %}
 
44
  {%- endif %}
45
  {%- endif %}
46
- {%- generation -%}
47
  {%- if loop.index0 > ns.last_query_index %}
48
  {%- if loop.last or (not loop.last and reasoning_content) %}
49
  {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
@@ -73,13 +77,12 @@
73
  {%- endfor %}
74
  {%- endif %}
75
  {{- '<|im_end|>\n' }}
76
- {%- endgeneration -%}
77
  {%- elif message.role == "tool" %}
78
  {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
79
  {{- '<|im_start|>user' }}
80
  {%- endif %}
81
  {{- '\n<tool_response>\n' }}
82
- {{- content }}
83
  {{- '\n</tool_response>' }}
84
  {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
85
  {{- '<|im_end|>\n' }}
@@ -87,9 +90,8 @@
87
  {%- endif %}
88
  {%- endfor %}
89
  {%- if add_generation_prompt %}
90
- {%- if ns.thinking %}
91
- {{- '<|im_start|>assistant\n' }}
92
- {%- else %}
93
- {{- '<|im_start|>assistant\n<think>\n' }}
94
  {%- endif %}
95
  {%- 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 forward_message in messages %}
 
 
 
19
  {%- set index = (messages|length - 1) - loop.index0 %}
20
+ {%- set message = messages[index] %}
21
+ {%- set tool_start = '<tool_response>' %}
22
+ {%- set tool_start_length = tool_start|length %}
23
+ {%- set start_of_message = message.content[:tool_start_length] %}
24
+ {%- set tool_end = '</tool_response>' %}
25
+ {%- set tool_end_length = tool_end|length %}
26
+ {%- set start_pos = (message.content|length) - tool_end_length %}
27
+ {%- if start_pos < 0 %}
28
+ {%- set start_pos = 0 %}
29
+ {%- endif %}
30
+ {%- set end_of_message = message.content[start_pos:] %}
31
+ {%- if ns.multi_step_tool and message.role == "user" and not(start_of_message == tool_start and end_of_message == tool_end) %}
32
  {%- set ns.multi_step_tool = false %}
33
  {%- set ns.last_query_index = index %}
34
  {%- endif %}
35
  {%- endfor %}
36
  {%- for message in messages %}
 
 
 
 
 
37
  {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
38
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
39
  {%- elif message.role == "assistant" %}
40
+ {%- set content = message.content %}
41
  {%- set reasoning_content = '' %}
42
+ {%- if message.reasoning_content is defined and message.reasoning_content is not none %}
43
  {%- set reasoning_content = message.reasoning_content %}
44
  {%- else %}
45
+ {%- if '</think>' in message.content %}
46
+ {%- set content = (message.content.split('</think>')|last).lstrip('\n') %}
47
+ {%- set reasoning_content = (message.content.split('</think>')|first).rstrip('\n') %}
48
+ {%- set reasoning_content = (reasoning_content.split('<think>')|last).lstrip('\n') %}
49
  {%- endif %}
50
  {%- endif %}
 
51
  {%- if loop.index0 > ns.last_query_index %}
52
  {%- if loop.last or (not loop.last and reasoning_content) %}
53
  {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
 
77
  {%- endfor %}
78
  {%- endif %}
79
  {{- '<|im_end|>\n' }}
 
80
  {%- elif message.role == "tool" %}
81
  {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
82
  {{- '<|im_start|>user' }}
83
  {%- endif %}
84
  {{- '\n<tool_response>\n' }}
85
+ {{- message.content }}
86
  {{- '\n</tool_response>' }}
87
  {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
88
  {{- '<|im_end|>\n' }}
 
90
  {%- endif %}
91
  {%- endfor %}
92
  {%- if add_generation_prompt %}
93
+ {{- '<|im_start|>assistant\n' }}
94
+ {%- if enable_thinking is defined and enable_thinking is false %}
95
+ {{- '<think>\n\n</think>\n\n' }}
 
96
  {%- endif %}
97
  {%- endif %}
config.json CHANGED
@@ -49,21 +49,22 @@
49
  "full_attention",
50
  "full_attention"
51
  ],
52
- "max_position_embeddings": 262144,
53
  "max_window_layers": 36,
54
  "model_type": "qwen3",
55
  "num_attention_heads": 32,
56
  "num_hidden_layers": 36,
57
  "num_key_value_heads": 8,
58
- "pad_token_id": 151643,
59
  "rms_norm_eps": 1e-06,
60
  "rope_scaling": null,
61
- "rope_theta": 5000000,
62
  "sliding_window": null,
63
  "tie_word_embeddings": true,
64
  "transformers_version": "4.57.6",
 
65
  "unsloth_version": "2026.1.2",
66
- "use_cache": false,
67
  "use_sliding_window": false,
68
  "vocab_size": 151936
69
  }
 
49
  "full_attention",
50
  "full_attention"
51
  ],
52
+ "max_position_embeddings": 40960,
53
  "max_window_layers": 36,
54
  "model_type": "qwen3",
55
  "num_attention_heads": 32,
56
  "num_hidden_layers": 36,
57
  "num_key_value_heads": 8,
58
+ "pad_token_id": 151654,
59
  "rms_norm_eps": 1e-06,
60
  "rope_scaling": null,
61
+ "rope_theta": 1000000,
62
  "sliding_window": null,
63
  "tie_word_embeddings": true,
64
  "transformers_version": "4.57.6",
65
+ "unsloth_fixed": true,
66
  "unsloth_version": "2026.1.2",
67
+ "use_cache": true,
68
  "use_sliding_window": false,
69
  "vocab_size": 151936
70
  }
model-00001-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:95c6b1f6a0a3c9f26518b962b64fb3ef76da60a0271970852d0d198594e5f773
3
  size 4967215360
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fe8e6b0b503b6297c971fcfc8a876d14368b5e734601921864039d49fd1886b0
3
  size 4967215360
model-00002-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c87eda0d7829d8223ecafa3cec1df2cd894360b2c8dc679480f445a2382a4bd3
3
  size 3077766632
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:999b2d4b755cac9ad2d15214a4891a0de66561bdda7d34863bb03ac674848d1c
3
  size 3077766632
model.safetensors.index.json CHANGED
@@ -1,6 +1,5 @@
1
  {
2
  "metadata": {
3
- "total_parameters": 4022468096,
4
  "total_size": 8044936192
5
  },
6
  "weight_map": {
 
1
  {
2
  "metadata": {
 
3
  "total_size": 8044936192
4
  },
5
  "weight_map": {
special_tokens_map.json CHANGED
@@ -22,7 +22,7 @@
22
  "single_word": false
23
  },
24
  "pad_token": {
25
- "content": "<|endoftext|>",
26
  "lstrip": false,
27
  "normalized": false,
28
  "rstrip": false,
 
22
  "single_word": false
23
  },
24
  "pad_token": {
25
+ "content": "<|vision_pad|>",
26
  "lstrip": false,
27
  "normalized": false,
28
  "rstrip": false,
tokenizer_config.json CHANGED
@@ -231,11 +231,11 @@
231
  "eos_token": "<|im_end|>",
232
  "errors": "replace",
233
  "extra_special_tokens": {},
234
- "model_max_length": 262144,
235
- "pad_token": "<|endoftext|>",
236
  "padding_side": "left",
237
  "split_special_tokens": false,
238
  "tokenizer_class": "Qwen2Tokenizer",
239
  "unk_token": null,
240
- "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, thinking=false) %}\n{%- for message in messages[::-1] %}\n {%- if message.role == \"system\" and message.content and message.content | trim != \"\" %}\n {%- set ns.thinking = true %}\n {%- endif %}\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 {%- if ns.thinking %}\n {{- '<|im_start|>assistant\\n' }}\n {%- else %}\n {{- '<|im_start|>assistant\\n<think>\\n' }}\n {%- endif %}\n{%- endif %}"
241
  }
 
231
  "eos_token": "<|im_end|>",
232
  "errors": "replace",
233
  "extra_special_tokens": {},
234
+ "model_max_length": 40960,
235
+ "pad_token": "<|vision_pad|>",
236
  "padding_side": "left",
237
  "split_special_tokens": false,
238
  "tokenizer_class": "Qwen2Tokenizer",
239
  "unk_token": null,
240
+ "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 forward_message in messages %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- set message = messages[index] %}\n {%- set tool_start = '<tool_response>' %}\n {%- set tool_start_length = tool_start|length %}\n {%- set start_of_message = message.content[:tool_start_length] %}\n {%- set tool_end = '</tool_response>' %}\n {%- set tool_end_length = tool_end|length %}\n {%- set start_pos = (message.content|length) - tool_end_length %}\n {%- if start_pos < 0 %}\n {%- set start_pos = 0 %}\n {%- endif %}\n {%- set end_of_message = message.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 %}"
241
  }