yujiepan commited on
Commit
5554360
·
verified ·
1 Parent(s): 8d6238c

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
.meta.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "torch": "2.11.0+cu128",
3
+ "transformers": "5.13.0"
4
+ }
README.md ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ base_model:
4
+ - zai-org/GLM-5.2
5
+ ---
6
+
7
+ This tiny model is intended for debugging. It is randomly initialized using the configuration adapted from [zai-org/GLM-5.2](https://huggingface.co/zai-org/GLM-5.2).
8
+
9
+ | File path | Size |
10
+ |------|------|
11
+ | model.safetensors | 26.2MB |
12
+
13
+
14
+ ### Example usage:
15
+
16
+ - vLLM
17
+
18
+ ```bash
19
+ # Multi-token prediction is supported
20
+ model_id=tiny-random/glm-5.2
21
+ vllm serve $model_id \
22
+ --tensor-parallel-size 2 \
23
+ --speculative-config.method mtp \
24
+ --speculative-config.num_speculative_tokens 1 \
25
+ --tool-call-parser glm47 \
26
+ --reasoning-parser glm45 \
27
+ --enable-auto-tool-choice
28
+ ```
29
+
30
+ - SGLang
31
+
32
+ ```bash
33
+ # Multi-token prediction is supported
34
+ model_id=tiny-random/glm-5.2
35
+ python3 -m sglang.launch_server --model-path $model_id --tp-size 2 \
36
+ --tool-call-parser glm47 \
37
+ --reasoning-parser glm45 \
38
+ --speculative-algorithm EAGLE \
39
+ --speculative-num-steps 3 \
40
+ --speculative-eagle-topk 1 \
41
+ --speculative-num-draft-tokens 4
42
+ ```
43
+
44
+ - Transformers
45
+
46
+ ```python
47
+ import torch
48
+ from transformers import AutoModelForCausalLM, AutoTokenizer
49
+
50
+ model_id = "tiny-random/glm-5.2"
51
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
52
+ print('Using device:', device)
53
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
54
+ input_ids = torch.randint(1000, 2000, size=(1, 2333), dtype=torch.long).to(device) # trigger DSA
55
+ model = AutoModelForCausalLM.from_pretrained(
56
+ model_id,
57
+ dtype=torch.bfloat16,
58
+ device_map=device,
59
+ )
60
+ generated_ids = model.generate(input_ids, max_new_tokens=8)
61
+ output_text = tokenizer.decode(generated_ids[0][input_ids.shape[1]:])
62
+ print(output_text)
63
+ ```
64
+
65
+ ### Codes to create this repo:
66
+
67
+ <details>
68
+ <summary>Click to expand</summary>
69
+
70
+ ```python
71
+ import json
72
+ from copy import deepcopy
73
+ from pathlib import Path
74
+
75
+ import accelerate
76
+ import torch
77
+ import torch.nn as nn
78
+ from huggingface_hub import file_exists, hf_hub_download
79
+ from transformers import (
80
+ AutoConfig,
81
+ AutoModelForCausalLM,
82
+ AutoProcessor,
83
+ GenerationConfig,
84
+ set_seed,
85
+ )
86
+
87
+ source_model_id = "zai-org/GLM-5.2"
88
+ save_folder = "/tmp/tiny-random/glm-52"
89
+
90
+ processor = AutoProcessor.from_pretrained(
91
+ source_model_id, trust_remote_code=True)
92
+ processor.save_pretrained(save_folder)
93
+
94
+ with open(hf_hub_download(source_model_id, filename='config.json', repo_type='model'), 'r', encoding='utf-8') as f:
95
+ config_json: dict = json.load(f)
96
+
97
+ config_json.update({
98
+ "first_k_dense_replace": 1,
99
+ "mlp_layer_types": ['dense'] + ['sparse'] * 3,
100
+ "hidden_size": 8,
101
+ "index_n_heads": 4,
102
+ "indexer_types": ['full'] + ['shared'] * 3,
103
+ "intermediate_size": 32,
104
+ "moe_intermediate_size": 32,
105
+ "num_hidden_layers": 4,
106
+ "num_attention_heads": 8,
107
+ 'num_key_value_heads': 8,
108
+ 'q_lora_rank': 32,
109
+ 'tie_word_embeddings': False,
110
+ })
111
+ with open(f"{save_folder}/config.json", "w", encoding='utf-8') as f:
112
+ json.dump(config_json, f, indent=2)
113
+
114
+ config = AutoConfig.from_pretrained(
115
+ save_folder,
116
+ trust_remote_code=True,
117
+ )
118
+ print(config)
119
+ torch.set_default_dtype(torch.bfloat16)
120
+ model = AutoModelForCausalLM.from_config(config, dtype=torch.bfloat16)
121
+ torch.set_default_dtype(torch.float32)
122
+
123
+ if file_exists(filename="generation_config.json", repo_id=source_model_id, repo_type='model'):
124
+ model.generation_config = GenerationConfig.from_pretrained(
125
+ source_model_id, trust_remote_code=True,
126
+ )
127
+ model.generation_config.do_sample = True
128
+ print(model.generation_config)
129
+
130
+ model = model.cpu()
131
+ set_seed(42)
132
+ n_params = sum(p.numel() for p in model.parameters())
133
+ with torch.no_grad():
134
+ for name, p in sorted(model.named_parameters()):
135
+ torch.nn.init.normal_(p, 0, 0.2)
136
+ mb = p.numel() / 1024 / 1024 * p.element_size()
137
+ print(name, p.shape, f'{p.numel() / n_params:.2%}', f'{mb:.2f}MB')
138
+ # MTP
139
+ set_seed(42)
140
+ model.model.layers.append(nn.ModuleDict(dict(
141
+ shared_head=nn.ModuleDict(dict(
142
+ norm=nn.RMSNorm(config.hidden_size),
143
+ # head=deepcopy(model.model.embed_tokens),
144
+ )),
145
+ # embed_tokens=deepcopy(model.model.embed_tokens),
146
+ eh_proj=nn.Linear(config.hidden_size * 2,
147
+ config.hidden_size, bias=False),
148
+ enorm=nn.RMSNorm(config.hidden_size),
149
+ hnorm=nn.RMSNorm(config.hidden_size),
150
+ input_layernorm=nn.RMSNorm(config.hidden_size),
151
+ post_attention_layernorm=nn.RMSNorm(config.hidden_size),
152
+ self_attn=deepcopy(model.model.layers[1].self_attn),
153
+ mlp=deepcopy(model.model.layers[1].mlp),
154
+ )))
155
+ for i in range(1, len(model.model.layers)):
156
+ model.model.layers[i].mlp.gate.e_score_correction_bias = torch.rand_like(
157
+ model.model.layers[i].mlp.gate.e_score_correction_bias).float()
158
+ model.save_pretrained(save_folder)
159
+ print(model)
160
+ ```
161
+
162
+ </details>
163
+
164
+ ### Printing the model:
165
+
166
+ <details><summary>Click to expand</summary>
167
+
168
+ ```text
169
+ GlmMoeDsaForCausalLM(
170
+ (model): GlmMoeDsaModel(
171
+ (embed_tokens): Embedding(154880, 8, padding_idx=154820)
172
+ (layers): ModuleList(
173
+ (0): GlmMoeDsaDecoderLayer(
174
+ (self_attn): GlmMoeDsaAttention(
175
+ (q_a_proj): Linear(in_features=8, out_features=32, bias=False)
176
+ (q_a_layernorm): GlmMoeDsaRMSNorm((32,), eps=1e-06)
177
+ (q_b_proj): Linear(in_features=32, out_features=2048, bias=False)
178
+ (kv_a_proj_with_mqa): Linear(in_features=8, out_features=576, bias=False)
179
+ (kv_a_layernorm): GlmMoeDsaRMSNorm((512,), eps=1e-06)
180
+ (kv_b_proj): Linear(in_features=512, out_features=3584, bias=False)
181
+ (o_proj): Linear(in_features=2048, out_features=8, bias=False)
182
+ (indexer): GlmMoeDsaIndexer(
183
+ (wq_b): Linear(in_features=32, out_features=512, bias=False)
184
+ (wk): Linear(in_features=8, out_features=128, bias=False)
185
+ (k_norm): LayerNorm((128,), eps=1e-06, elementwise_affine=True)
186
+ (weights_proj): Linear(in_features=8, out_features=4, bias=False)
187
+ )
188
+ )
189
+ (mlp): GlmMoeDsaMLP(
190
+ (gate_proj): Linear(in_features=8, out_features=32, bias=False)
191
+ (up_proj): Linear(in_features=8, out_features=32, bias=False)
192
+ (down_proj): Linear(in_features=32, out_features=8, bias=False)
193
+ (act_fn): SiLUActivation()
194
+ )
195
+ (input_layernorm): GlmMoeDsaRMSNorm((8,), eps=1e-05)
196
+ (post_attention_layernorm): GlmMoeDsaRMSNorm((8,), eps=1e-05)
197
+ )
198
+ (1-3): 3 x GlmMoeDsaDecoderLayer(
199
+ (self_attn): GlmMoeDsaAttention(
200
+ (q_a_proj): Linear(in_features=8, out_features=32, bias=False)
201
+ (q_a_layernorm): GlmMoeDsaRMSNorm((32,), eps=1e-06)
202
+ (q_b_proj): Linear(in_features=32, out_features=2048, bias=False)
203
+ (kv_a_proj_with_mqa): Linear(in_features=8, out_features=576, bias=False)
204
+ (kv_a_layernorm): GlmMoeDsaRMSNorm((512,), eps=1e-06)
205
+ (kv_b_proj): Linear(in_features=512, out_features=3584, bias=False)
206
+ (o_proj): Linear(in_features=2048, out_features=8, bias=False)
207
+ )
208
+ (mlp): GlmMoeDsaMoE(
209
+ (experts): GlmMoeDsaExperts(
210
+ (act_fn): SiLUActivation()
211
+ )
212
+ (gate): GlmMoeDsaTopkRouter()
213
+ (shared_experts): GlmMoeDsaMLP(
214
+ (gate_proj): Linear(in_features=8, out_features=32, bias=False)
215
+ (up_proj): Linear(in_features=8, out_features=32, bias=False)
216
+ (down_proj): Linear(in_features=32, out_features=8, bias=False)
217
+ (act_fn): SiLUActivation()
218
+ )
219
+ )
220
+ (input_layernorm): GlmMoeDsaRMSNorm((8,), eps=1e-05)
221
+ (post_attention_layernorm): GlmMoeDsaRMSNorm((8,), eps=1e-05)
222
+ )
223
+ (4): ModuleDict(
224
+ (shared_head): ModuleDict(
225
+ (norm): RMSNorm((8,), eps=None, elementwise_affine=True)
226
+ )
227
+ (eh_proj): Linear(in_features=16, out_features=8, bias=False)
228
+ (enorm): RMSNorm((8,), eps=None, elementwise_affine=True)
229
+ (hnorm): RMSNorm((8,), eps=None, elementwise_affine=True)
230
+ (input_layernorm): RMSNorm((8,), eps=None, elementwise_affine=True)
231
+ (post_attention_layernorm): RMSNorm((8,), eps=None, elementwise_affine=True)
232
+ (self_attn): GlmMoeDsaAttention(
233
+ (q_a_proj): Linear(in_features=8, out_features=32, bias=False)
234
+ (q_a_layernorm): GlmMoeDsaRMSNorm((32,), eps=1e-06)
235
+ (q_b_proj): Linear(in_features=32, out_features=2048, bias=False)
236
+ (kv_a_proj_with_mqa): Linear(in_features=8, out_features=576, bias=False)
237
+ (kv_a_layernorm): GlmMoeDsaRMSNorm((512,), eps=1e-06)
238
+ (kv_b_proj): Linear(in_features=512, out_features=3584, bias=False)
239
+ (o_proj): Linear(in_features=2048, out_features=8, bias=False)
240
+ )
241
+ (mlp): GlmMoeDsaMoE(
242
+ (experts): GlmMoeDsaExperts(
243
+ (act_fn): SiLUActivation()
244
+ )
245
+ (gate): GlmMoeDsaTopkRouter()
246
+ (shared_experts): GlmMoeDsaMLP(
247
+ (gate_proj): Linear(in_features=8, out_features=32, bias=False)
248
+ (up_proj): Linear(in_features=8, out_features=32, bias=False)
249
+ (down_proj): Linear(in_features=32, out_features=8, bias=False)
250
+ (act_fn): SiLUActivation()
251
+ )
252
+ )
253
+ )
254
+ )
255
+ (norm): GlmMoeDsaRMSNorm((8,), eps=1e-05)
256
+ (rotary_emb): GlmMoeDsaRotaryEmbedding()
257
+ )
258
+ (lm_head): Linear(in_features=8, out_features=154880, bias=False)
259
+ )
260
+ ```
261
+
262
+ </details>
263
+
264
+ ### Test environment:
265
+
266
+ - torch: 2.11.0+cu128
267
+ - transformers: 5.13.0
chat_template.jinja ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [gMASK]<sop>
2
+ {%- set effective_reasoning_effort = 'high' if reasoning_effort is defined and reasoning_effort == 'high' else 'max' -%}
3
+ {%- if (enable_thinking is not defined or enable_thinking) and effective_reasoning_effort is not none -%}<|system|>Reasoning Effort: {{ effective_reasoning_effort | capitalize }}{%- endif -%}
4
+ {%- if tools -%}
5
+ {%- macro tool_to_json(tool) -%}
6
+ {%- set ns_tool = namespace(first=true) -%}
7
+ {{ '{' -}}
8
+ {%- for k, v in tool.items() -%}
9
+ {%- if k != 'defer_loading' and k != 'strict' -%}
10
+ {%- if not ns_tool.first -%}{{- ', ' -}}{%- endif -%}
11
+ {%- set ns_tool.first = false -%}
12
+ "{{ k }}": {{ v | tojson(ensure_ascii=False) }}
13
+ {%- endif -%}
14
+ {%- endfor -%}
15
+ {{- '}' -}}
16
+ {%- endmacro -%}
17
+ <|system|>
18
+ # Tools
19
+
20
+ You may call one or more functions to assist with the user query.
21
+
22
+ You are provided with function signatures within <tools></tools> XML tags:
23
+ <tools>
24
+ {% for tool in tools %}
25
+ {%- if 'function' in tool -%}
26
+ {%- set tool = tool['function'] -%}
27
+ {%- endif -%}
28
+ {% if tool.defer_loading is not defined or not tool.defer_loading %}
29
+ {{ tool_to_json(tool) }}
30
+ {% endif %}
31
+ {% endfor %}
32
+ </tools>
33
+
34
+ For each function call, output the function name and arguments within the following XML format:
35
+ <tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value><arg_key>{arg-key-2}</arg_key><arg_value>{arg-value-2}</arg_value>...</tool_call>{%- endif -%}
36
+ {%- macro visible_text(content) -%}
37
+ {%- if content is string -%}
38
+ {{- content }}
39
+ {%- elif content is iterable and content is not mapping -%}
40
+ {%- for item in content -%}
41
+ {%- if item is mapping and item.type == 'text' -%}
42
+ {{- item.text }}
43
+ {%- elif item is string -%}
44
+ {{- item }}
45
+ {%- elif item is mapping and item.type in ['image', 'image_url', 'video', 'video_url', 'audio', 'audio_url', 'input_audio'] -%}
46
+ {%- set media_type = item.type | replace('_url', '') | replace('input_', '') -%}
47
+ {{- "<reminder>You are unable to process this " ~ media_type ~ " because you don't have multi-modal input ability. Try different methods.</reminder>" }}
48
+ {%- endif -%}
49
+ {%- endfor -%}
50
+ {%- else -%}
51
+ {{- content }}
52
+ {%- endif -%}
53
+ {%- endmacro -%}
54
+ {%- set ns = namespace(last_user_index=-1) -%}
55
+ {%- for m in messages %}
56
+ {%- if m.role == 'user' %}
57
+ {%- set ns.last_user_index = loop.index0 -%}
58
+ {%- endif %}
59
+ {%- endfor %}
60
+ {%- for m in messages -%}
61
+ {%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}
62
+ {%- elif m.role == 'assistant' -%}
63
+ <|assistant|>
64
+ {%- set content = visible_text(m.content) %}
65
+ {%- if m.reasoning_content is string %}
66
+ {%- set reasoning_content = m.reasoning_content %}
67
+ {%- elif '</think>' in content %}
68
+ {%- set reasoning_content = content.split('</think>')[0].split('<think>')[-1] %}
69
+ {%- set content = content.split('</think>')[-1] %}
70
+ {%- endif %}
71
+ {%- if ((clear_thinking is defined and not clear_thinking) or loop.index0 > ns.last_user_index) and reasoning_content is defined -%}
72
+ {{ '<think>' + reasoning_content + '</think>'}}
73
+ {%- else -%}
74
+ {{ '<think></think>' }}
75
+ {%- endif -%}
76
+ {%- if content.strip() -%}
77
+ {{ content.strip() }}
78
+ {%- endif -%}
79
+ {% if m.tool_calls %}
80
+ {% for tc in m.tool_calls %}
81
+ {%- if tc.function %}
82
+ {%- set tc = tc.function %}
83
+ {%- endif %}
84
+ {{- '<tool_call>' + tc.name -}}
85
+ {% set _args = tc.arguments %}{% for k, v in _args.items() %}<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>{% endfor %}</tool_call>{% endfor %}
86
+ {% endif %}
87
+ {%- elif m.role == 'tool' -%}
88
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
89
+ {{- '<|observation|>' -}}
90
+ {%- endif %}
91
+ {%- if m.content is string -%}
92
+ {{- '<tool_response>' + m.content + '</tool_response>' -}}
93
+ {%- elif m.content is iterable and m.content is not mapping and m.content and m.content.0.type == "tool_reference" -%}
94
+ {{- '<tool_response><tools>\n' -}}
95
+ {% for tr in m.content %}
96
+ {%- for tool in tools -%}
97
+ {%- if 'function' in tool -%}
98
+ {%- set tool = tool['function'] -%}
99
+ {%- endif -%}
100
+ {%- if tool.name == tr.name -%}
101
+ {{- tool_to_json(tool) + '\n' -}}
102
+ {%- endif -%}
103
+ {%- endfor -%}
104
+ {%- endfor -%}
105
+ {{- '</tools></tool_response>' -}}
106
+ {%- elif m.content is iterable and m.content is not mapping and m.content and m.content.0 is mapping and m.content.0.output is defined -%}
107
+ {%- for tr in m.content -%}
108
+ {{- '<tool_response>' + tr.output + '</tool_response>' -}}
109
+ {%- endfor -%}
110
+ {%- else -%}
111
+ {{- '<tool_response>' + visible_text(m.content) + '</tool_response>' -}}
112
+ {% endif -%}
113
+ {%- elif m.role == 'system' -%}
114
+ <|system|>{{ visible_text(m.content) }}
115
+ {%- endif -%}
116
+ {%- endfor -%}
117
+ {%- if add_generation_prompt -%}
118
+ <|assistant|>{{- '<think></think>' if (enable_thinking is defined and not enable_thinking) else '<think>' -}}
119
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "GlmMoeDsaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 0,
8
+ "dtype": "bfloat16",
9
+ "eos_token_id": [
10
+ 154820,
11
+ 154827,
12
+ 154829
13
+ ],
14
+ "ep_size": 1,
15
+ "first_k_dense_replace": 1,
16
+ "head_dim": 64,
17
+ "hidden_act": "silu",
18
+ "hidden_size": 8,
19
+ "index_head_dim": 128,
20
+ "index_n_heads": 4,
21
+ "index_share_for_mtp_iteration": true,
22
+ "index_skip_topk_offset": 3,
23
+ "index_topk": 2048,
24
+ "index_topk_freq": 4,
25
+ "index_topk_pattern": null,
26
+ "indexer_rope_interleave": true,
27
+ "indexer_types": [
28
+ "full",
29
+ "shared",
30
+ "shared",
31
+ "shared"
32
+ ],
33
+ "initializer_range": 0.02,
34
+ "intermediate_size": 32,
35
+ "kv_lora_rank": 512,
36
+ "layer_types": [
37
+ "deepseek_sparse_attention",
38
+ "deepseek_sparse_attention",
39
+ "deepseek_sparse_attention",
40
+ "deepseek_sparse_attention"
41
+ ],
42
+ "max_position_embeddings": 1048576,
43
+ "mlp_bias": false,
44
+ "mlp_layer_types": [
45
+ "dense",
46
+ "sparse",
47
+ "sparse",
48
+ "sparse"
49
+ ],
50
+ "model_type": "glm_moe_dsa",
51
+ "moe_intermediate_size": 32,
52
+ "moe_layer_freq": 1,
53
+ "moe_router_dtype": "float32",
54
+ "n_group": 1,
55
+ "n_routed_experts": 256,
56
+ "n_shared_experts": 1,
57
+ "norm_topk_prob": true,
58
+ "num_attention_heads": 8,
59
+ "num_experts_per_tok": 8,
60
+ "num_hidden_layers": 4,
61
+ "num_key_value_heads": 8,
62
+ "num_nextn_predict_layers": 1,
63
+ "pad_token_id": 154820,
64
+ "pretraining_tp": 1,
65
+ "q_lora_rank": 32,
66
+ "qk_head_dim": 256,
67
+ "qk_nope_head_dim": 192,
68
+ "qk_rope_head_dim": 64,
69
+ "rms_norm_eps": 1e-05,
70
+ "rope_interleave": true,
71
+ "rope_parameters": {
72
+ "rope_theta": 8000000,
73
+ "rope_type": "default"
74
+ },
75
+ "routed_scaling_factor": 2.5,
76
+ "scoring_func": "sigmoid",
77
+ "tie_word_embeddings": false,
78
+ "topk_group": 1,
79
+ "topk_method": "noaux_tc",
80
+ "transformers_version": "5.13.0",
81
+ "use_cache": true,
82
+ "v_head_dim": 256,
83
+ "vocab_size": 154880
84
+ }
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 154820,
6
+ 154827,
7
+ 154829
8
+ ],
9
+ "pad_token_id": 154820,
10
+ "temperature": 1.0,
11
+ "top_p": 0.95,
12
+ "transformers_version": "5.13.0"
13
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18db746dbdfb49ec5e6a211a7fa2223b7bc0011e33cd8916f43a5f1435cd9f24
3
+ size 26180088
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19e773648cb4e65de8660ea6365e10acca112d42a854923df93db4a6f333a82d
3
+ size 20217442
tokenizer_config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "clean_up_tokenization_spaces": false,
4
+ "do_lower_case": false,
5
+ "eos_token": "<|endoftext|>",
6
+ "extra_special_tokens": [
7
+ "<|endoftext|>",
8
+ "[MASK]",
9
+ "[gMASK]",
10
+ "[sMASK]",
11
+ "<sop>",
12
+ "<eop>",
13
+ "<|system|>",
14
+ "<|user|>",
15
+ "<|assistant|>",
16
+ "<|observation|>",
17
+ "<|begin_of_image|>",
18
+ "<|end_of_image|>",
19
+ "<|begin_of_video|>",
20
+ "<|end_of_video|>",
21
+ "<|begin_of_audio|>",
22
+ "<|end_of_audio|>",
23
+ "<|begin_of_transcription|>",
24
+ "<|end_of_transcription|>"
25
+ ],
26
+ "is_local": false,
27
+ "local_files_only": false,
28
+ "model_max_length": 1048576,
29
+ "model_specific_special_tokens": {},
30
+ "pad_token": "<|endoftext|>",
31
+ "padding_side": "left",
32
+ "remove_space": false,
33
+ "tokenizer_class": "TokenizersBackend"
34
+ }