nightmedia commited on
Commit
bc2b608
·
verified ·
1 Parent(s): 31e7abf

Add files using upload-large-folder tool

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
README.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ base_model: inclusionAI/Ring-mini-sparse-2.0-exp
6
+ pipeline_tag: text-generation
7
+ library_name: mlx
8
+ tags:
9
+ - moe
10
+ - mlx
11
+ ---
12
+
13
+ # Ring-mini-sparse-2.0-exp-qx86-mlx
14
+
15
+ This model [Ring-mini-sparse-2.0-exp-qx86-mlx](https://huggingface.co/Ring-mini-sparse-2.0-exp-qx86-mlx) was
16
+ converted to MLX format from [inclusionAI/Ring-mini-sparse-2.0-exp](https://huggingface.co/inclusionAI/Ring-mini-sparse-2.0-exp)
17
+ using mlx-lm version **0.28.3**.
18
+
19
+ ## Use with mlx
20
+
21
+ ```bash
22
+ pip install mlx-lm
23
+ ```
24
+
25
+ ```python
26
+ from mlx_lm import load, generate
27
+
28
+ model, tokenizer = load("Ring-mini-sparse-2.0-exp-qx86-mlx")
29
+
30
+ prompt = "hello"
31
+
32
+ if tokenizer.chat_template is not None:
33
+ messages = [{"role": "user", "content": prompt}]
34
+ prompt = tokenizer.apply_chat_template(
35
+ messages, add_generation_prompt=True
36
+ )
37
+
38
+ response = generate(model, tokenizer, prompt=prompt, verbose=True)
39
+ ```
chat_template.jinja ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {% for message in messages %}{% set role = message['role'] | lower %}{% if role == 'user' %}{% set role = 'HUMAN' %}{% endif %}{% set role = role | upper %}{{ '<role>' + role + '</role>' + message['content'] }}{% endfor %}{% if add_generation_prompt %}{{ '<role>ASSISTANT</role><think>
2
+ ' }}{% endif %}
config.json ADDED
@@ -0,0 +1,1509 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BailingMoeV2ForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "auto_map": {
7
+ "AutoConfig": "configuration_bailing_moe_v2.BailingMoeV2Config",
8
+ "AutoModel": "modeling_bailing_moe_v2.BailingMoeV2Model",
9
+ "AutoModelForCausalLM": "modeling_bailing_moe_v2.BailingMoeV2ForCausalLM"
10
+ },
11
+ "embedding_dropout": 0.0,
12
+ "eos_token_id": 156892,
13
+ "first_k_dense_replace": 1,
14
+ "head_dim": 128,
15
+ "hidden_act": "silu",
16
+ "hidden_size": 2048,
17
+ "intermediate_size": 5120,
18
+ "max_position_embeddings": 32768,
19
+ "moba_block_size": 1024,
20
+ "moba_layer_freq": [
21
+ 0,
22
+ 0,
23
+ 0,
24
+ 1,
25
+ 1,
26
+ 1,
27
+ 1,
28
+ 1,
29
+ 1,
30
+ 1,
31
+ 1,
32
+ 1,
33
+ 1,
34
+ 1,
35
+ 1,
36
+ 1,
37
+ 1,
38
+ 1,
39
+ 1,
40
+ 0
41
+ ],
42
+ "moba_topk": 8,
43
+ "model_type": "bailing_moe",
44
+ "moe_intermediate_size": 512,
45
+ "moe_router_enable_expert_bias": true,
46
+ "moe_shared_expert_intermediate_size": 512,
47
+ "n_group": 8,
48
+ "norm_topk_prob": true,
49
+ "num_attention_heads": 16,
50
+ "num_experts": 256,
51
+ "num_experts_per_tok": 8,
52
+ "num_hidden_layers": 20,
53
+ "num_key_value_heads": 4,
54
+ "num_shared_experts": 1,
55
+ "output_dropout": 0.0,
56
+ "pad_token_id": 156892,
57
+ "partial_rotary_factor": 0.5,
58
+ "quantization": {
59
+ "group_size": 64,
60
+ "bits": 6,
61
+ "mode": "affine",
62
+ "model.word_embeddings": {
63
+ "group_size": 32,
64
+ "bits": 8
65
+ },
66
+ "model.layers.0.attention.query_key_value": {
67
+ "group_size": 32,
68
+ "bits": 8
69
+ },
70
+ "model.layers.0.attention.dense": {
71
+ "group_size": 32,
72
+ "bits": 8
73
+ },
74
+ "model.layers.0.mlp.gate_proj": {
75
+ "group_size": 32,
76
+ "bits": 8
77
+ },
78
+ "model.layers.0.mlp.down_proj": {
79
+ "group_size": 32,
80
+ "bits": 8
81
+ },
82
+ "model.layers.0.mlp.up_proj": {
83
+ "group_size": 32,
84
+ "bits": 8
85
+ },
86
+ "model.layers.1.attention.query_key_value": {
87
+ "group_size": 32,
88
+ "bits": 8
89
+ },
90
+ "model.layers.1.attention.dense": {
91
+ "group_size": 32,
92
+ "bits": 8
93
+ },
94
+ "model.layers.1.mlp.switch_mlp.gate_proj": {
95
+ "group_size": 32,
96
+ "bits": 8
97
+ },
98
+ "model.layers.1.mlp.switch_mlp.up_proj": {
99
+ "group_size": 32,
100
+ "bits": 8
101
+ },
102
+ "model.layers.1.mlp.switch_mlp.down_proj": {
103
+ "group_size": 32,
104
+ "bits": 8
105
+ },
106
+ "model.layers.1.mlp.gate.gate_proj": {
107
+ "group_size": 32,
108
+ "bits": 8
109
+ },
110
+ "model.layers.1.mlp.shared_experts.gate_proj": {
111
+ "group_size": 32,
112
+ "bits": 8
113
+ },
114
+ "model.layers.1.mlp.shared_experts.down_proj": {
115
+ "group_size": 32,
116
+ "bits": 8
117
+ },
118
+ "model.layers.1.mlp.shared_experts.up_proj": {
119
+ "group_size": 32,
120
+ "bits": 8
121
+ },
122
+ "model.layers.2.attention.query_key_value": {
123
+ "group_size": 32,
124
+ "bits": 8
125
+ },
126
+ "model.layers.2.attention.dense": {
127
+ "group_size": 32,
128
+ "bits": 8
129
+ },
130
+ "model.layers.2.mlp.switch_mlp.gate_proj": {
131
+ "group_size": 64,
132
+ "bits": 6
133
+ },
134
+ "model.layers.2.mlp.switch_mlp.up_proj": {
135
+ "group_size": 64,
136
+ "bits": 6
137
+ },
138
+ "model.layers.2.mlp.switch_mlp.down_proj": {
139
+ "group_size": 64,
140
+ "bits": 6
141
+ },
142
+ "model.layers.2.mlp.gate.gate_proj": {
143
+ "group_size": 64,
144
+ "bits": 6
145
+ },
146
+ "model.layers.2.mlp.shared_experts.gate_proj": {
147
+ "group_size": 32,
148
+ "bits": 8
149
+ },
150
+ "model.layers.2.mlp.shared_experts.down_proj": {
151
+ "group_size": 32,
152
+ "bits": 8
153
+ },
154
+ "model.layers.2.mlp.shared_experts.up_proj": {
155
+ "group_size": 32,
156
+ "bits": 8
157
+ },
158
+ "model.layers.3.attention.query_key_value": {
159
+ "group_size": 32,
160
+ "bits": 8
161
+ },
162
+ "model.layers.3.attention.dense": {
163
+ "group_size": 32,
164
+ "bits": 8
165
+ },
166
+ "model.layers.3.mlp.switch_mlp.gate_proj": {
167
+ "group_size": 64,
168
+ "bits": 6
169
+ },
170
+ "model.layers.3.mlp.switch_mlp.up_proj": {
171
+ "group_size": 64,
172
+ "bits": 6
173
+ },
174
+ "model.layers.3.mlp.switch_mlp.down_proj": {
175
+ "group_size": 64,
176
+ "bits": 6
177
+ },
178
+ "model.layers.3.mlp.gate.gate_proj": {
179
+ "group_size": 64,
180
+ "bits": 6
181
+ },
182
+ "model.layers.3.mlp.shared_experts.gate_proj": {
183
+ "group_size": 32,
184
+ "bits": 8
185
+ },
186
+ "model.layers.3.mlp.shared_experts.down_proj": {
187
+ "group_size": 32,
188
+ "bits": 8
189
+ },
190
+ "model.layers.3.mlp.shared_experts.up_proj": {
191
+ "group_size": 32,
192
+ "bits": 8
193
+ },
194
+ "model.layers.4.attention.query_key_value": {
195
+ "group_size": 32,
196
+ "bits": 8
197
+ },
198
+ "model.layers.4.attention.dense": {
199
+ "group_size": 32,
200
+ "bits": 8
201
+ },
202
+ "model.layers.4.mlp.switch_mlp.gate_proj": {
203
+ "group_size": 64,
204
+ "bits": 6
205
+ },
206
+ "model.layers.4.mlp.switch_mlp.up_proj": {
207
+ "group_size": 64,
208
+ "bits": 6
209
+ },
210
+ "model.layers.4.mlp.switch_mlp.down_proj": {
211
+ "group_size": 64,
212
+ "bits": 6
213
+ },
214
+ "model.layers.4.mlp.gate.gate_proj": {
215
+ "group_size": 64,
216
+ "bits": 6
217
+ },
218
+ "model.layers.4.mlp.shared_experts.gate_proj": {
219
+ "group_size": 32,
220
+ "bits": 8
221
+ },
222
+ "model.layers.4.mlp.shared_experts.down_proj": {
223
+ "group_size": 32,
224
+ "bits": 8
225
+ },
226
+ "model.layers.4.mlp.shared_experts.up_proj": {
227
+ "group_size": 32,
228
+ "bits": 8
229
+ },
230
+ "model.layers.5.attention.query_key_value": {
231
+ "group_size": 32,
232
+ "bits": 8
233
+ },
234
+ "model.layers.5.attention.dense": {
235
+ "group_size": 32,
236
+ "bits": 8
237
+ },
238
+ "model.layers.5.mlp.switch_mlp.gate_proj": {
239
+ "group_size": 64,
240
+ "bits": 6
241
+ },
242
+ "model.layers.5.mlp.switch_mlp.up_proj": {
243
+ "group_size": 64,
244
+ "bits": 6
245
+ },
246
+ "model.layers.5.mlp.switch_mlp.down_proj": {
247
+ "group_size": 64,
248
+ "bits": 6
249
+ },
250
+ "model.layers.5.mlp.gate.gate_proj": {
251
+ "group_size": 64,
252
+ "bits": 6
253
+ },
254
+ "model.layers.5.mlp.shared_experts.gate_proj": {
255
+ "group_size": 32,
256
+ "bits": 8
257
+ },
258
+ "model.layers.5.mlp.shared_experts.down_proj": {
259
+ "group_size": 32,
260
+ "bits": 8
261
+ },
262
+ "model.layers.5.mlp.shared_experts.up_proj": {
263
+ "group_size": 32,
264
+ "bits": 8
265
+ },
266
+ "model.layers.6.attention.query_key_value": {
267
+ "group_size": 32,
268
+ "bits": 8
269
+ },
270
+ "model.layers.6.attention.dense": {
271
+ "group_size": 32,
272
+ "bits": 8
273
+ },
274
+ "model.layers.6.mlp.switch_mlp.gate_proj": {
275
+ "group_size": 64,
276
+ "bits": 6
277
+ },
278
+ "model.layers.6.mlp.switch_mlp.up_proj": {
279
+ "group_size": 64,
280
+ "bits": 6
281
+ },
282
+ "model.layers.6.mlp.switch_mlp.down_proj": {
283
+ "group_size": 64,
284
+ "bits": 6
285
+ },
286
+ "model.layers.6.mlp.gate.gate_proj": {
287
+ "group_size": 64,
288
+ "bits": 6
289
+ },
290
+ "model.layers.6.mlp.shared_experts.gate_proj": {
291
+ "group_size": 32,
292
+ "bits": 8
293
+ },
294
+ "model.layers.6.mlp.shared_experts.down_proj": {
295
+ "group_size": 32,
296
+ "bits": 8
297
+ },
298
+ "model.layers.6.mlp.shared_experts.up_proj": {
299
+ "group_size": 32,
300
+ "bits": 8
301
+ },
302
+ "model.layers.7.attention.query_key_value": {
303
+ "group_size": 32,
304
+ "bits": 8
305
+ },
306
+ "model.layers.7.attention.dense": {
307
+ "group_size": 32,
308
+ "bits": 8
309
+ },
310
+ "model.layers.7.mlp.switch_mlp.gate_proj": {
311
+ "group_size": 64,
312
+ "bits": 6
313
+ },
314
+ "model.layers.7.mlp.switch_mlp.up_proj": {
315
+ "group_size": 64,
316
+ "bits": 6
317
+ },
318
+ "model.layers.7.mlp.switch_mlp.down_proj": {
319
+ "group_size": 64,
320
+ "bits": 6
321
+ },
322
+ "model.layers.7.mlp.gate.gate_proj": {
323
+ "group_size": 64,
324
+ "bits": 6
325
+ },
326
+ "model.layers.7.mlp.shared_experts.gate_proj": {
327
+ "group_size": 32,
328
+ "bits": 8
329
+ },
330
+ "model.layers.7.mlp.shared_experts.down_proj": {
331
+ "group_size": 32,
332
+ "bits": 8
333
+ },
334
+ "model.layers.7.mlp.shared_experts.up_proj": {
335
+ "group_size": 32,
336
+ "bits": 8
337
+ },
338
+ "model.layers.8.attention.query_key_value": {
339
+ "group_size": 32,
340
+ "bits": 8
341
+ },
342
+ "model.layers.8.attention.dense": {
343
+ "group_size": 32,
344
+ "bits": 8
345
+ },
346
+ "model.layers.8.mlp.switch_mlp.gate_proj": {
347
+ "group_size": 64,
348
+ "bits": 6
349
+ },
350
+ "model.layers.8.mlp.switch_mlp.up_proj": {
351
+ "group_size": 64,
352
+ "bits": 6
353
+ },
354
+ "model.layers.8.mlp.switch_mlp.down_proj": {
355
+ "group_size": 64,
356
+ "bits": 6
357
+ },
358
+ "model.layers.8.mlp.gate.gate_proj": {
359
+ "group_size": 64,
360
+ "bits": 6
361
+ },
362
+ "model.layers.8.mlp.shared_experts.gate_proj": {
363
+ "group_size": 32,
364
+ "bits": 8
365
+ },
366
+ "model.layers.8.mlp.shared_experts.down_proj": {
367
+ "group_size": 32,
368
+ "bits": 8
369
+ },
370
+ "model.layers.8.mlp.shared_experts.up_proj": {
371
+ "group_size": 32,
372
+ "bits": 8
373
+ },
374
+ "model.layers.9.attention.query_key_value": {
375
+ "group_size": 32,
376
+ "bits": 8
377
+ },
378
+ "model.layers.9.attention.dense": {
379
+ "group_size": 32,
380
+ "bits": 8
381
+ },
382
+ "model.layers.9.mlp.switch_mlp.gate_proj": {
383
+ "group_size": 64,
384
+ "bits": 6
385
+ },
386
+ "model.layers.9.mlp.switch_mlp.up_proj": {
387
+ "group_size": 64,
388
+ "bits": 6
389
+ },
390
+ "model.layers.9.mlp.switch_mlp.down_proj": {
391
+ "group_size": 64,
392
+ "bits": 6
393
+ },
394
+ "model.layers.9.mlp.gate.gate_proj": {
395
+ "group_size": 64,
396
+ "bits": 6
397
+ },
398
+ "model.layers.9.mlp.shared_experts.gate_proj": {
399
+ "group_size": 32,
400
+ "bits": 8
401
+ },
402
+ "model.layers.9.mlp.shared_experts.down_proj": {
403
+ "group_size": 32,
404
+ "bits": 8
405
+ },
406
+ "model.layers.9.mlp.shared_experts.up_proj": {
407
+ "group_size": 32,
408
+ "bits": 8
409
+ },
410
+ "model.layers.10.attention.query_key_value": {
411
+ "group_size": 32,
412
+ "bits": 8
413
+ },
414
+ "model.layers.10.attention.dense": {
415
+ "group_size": 32,
416
+ "bits": 8
417
+ },
418
+ "model.layers.10.mlp.switch_mlp.gate_proj": {
419
+ "group_size": 64,
420
+ "bits": 6
421
+ },
422
+ "model.layers.10.mlp.switch_mlp.up_proj": {
423
+ "group_size": 64,
424
+ "bits": 6
425
+ },
426
+ "model.layers.10.mlp.switch_mlp.down_proj": {
427
+ "group_size": 64,
428
+ "bits": 6
429
+ },
430
+ "model.layers.10.mlp.gate.gate_proj": {
431
+ "group_size": 64,
432
+ "bits": 6
433
+ },
434
+ "model.layers.10.mlp.shared_experts.gate_proj": {
435
+ "group_size": 32,
436
+ "bits": 8
437
+ },
438
+ "model.layers.10.mlp.shared_experts.down_proj": {
439
+ "group_size": 32,
440
+ "bits": 8
441
+ },
442
+ "model.layers.10.mlp.shared_experts.up_proj": {
443
+ "group_size": 32,
444
+ "bits": 8
445
+ },
446
+ "model.layers.11.attention.query_key_value": {
447
+ "group_size": 32,
448
+ "bits": 8
449
+ },
450
+ "model.layers.11.attention.dense": {
451
+ "group_size": 32,
452
+ "bits": 8
453
+ },
454
+ "model.layers.11.mlp.switch_mlp.gate_proj": {
455
+ "group_size": 64,
456
+ "bits": 6
457
+ },
458
+ "model.layers.11.mlp.switch_mlp.up_proj": {
459
+ "group_size": 64,
460
+ "bits": 6
461
+ },
462
+ "model.layers.11.mlp.switch_mlp.down_proj": {
463
+ "group_size": 64,
464
+ "bits": 6
465
+ },
466
+ "model.layers.11.mlp.gate.gate_proj": {
467
+ "group_size": 64,
468
+ "bits": 6
469
+ },
470
+ "model.layers.11.mlp.shared_experts.gate_proj": {
471
+ "group_size": 32,
472
+ "bits": 8
473
+ },
474
+ "model.layers.11.mlp.shared_experts.down_proj": {
475
+ "group_size": 32,
476
+ "bits": 8
477
+ },
478
+ "model.layers.11.mlp.shared_experts.up_proj": {
479
+ "group_size": 32,
480
+ "bits": 8
481
+ },
482
+ "model.layers.12.attention.query_key_value": {
483
+ "group_size": 32,
484
+ "bits": 8
485
+ },
486
+ "model.layers.12.attention.dense": {
487
+ "group_size": 32,
488
+ "bits": 8
489
+ },
490
+ "model.layers.12.mlp.switch_mlp.gate_proj": {
491
+ "group_size": 64,
492
+ "bits": 6
493
+ },
494
+ "model.layers.12.mlp.switch_mlp.up_proj": {
495
+ "group_size": 64,
496
+ "bits": 6
497
+ },
498
+ "model.layers.12.mlp.switch_mlp.down_proj": {
499
+ "group_size": 64,
500
+ "bits": 6
501
+ },
502
+ "model.layers.12.mlp.gate.gate_proj": {
503
+ "group_size": 64,
504
+ "bits": 6
505
+ },
506
+ "model.layers.12.mlp.shared_experts.gate_proj": {
507
+ "group_size": 32,
508
+ "bits": 8
509
+ },
510
+ "model.layers.12.mlp.shared_experts.down_proj": {
511
+ "group_size": 32,
512
+ "bits": 8
513
+ },
514
+ "model.layers.12.mlp.shared_experts.up_proj": {
515
+ "group_size": 32,
516
+ "bits": 8
517
+ },
518
+ "model.layers.13.attention.query_key_value": {
519
+ "group_size": 32,
520
+ "bits": 8
521
+ },
522
+ "model.layers.13.attention.dense": {
523
+ "group_size": 32,
524
+ "bits": 8
525
+ },
526
+ "model.layers.13.mlp.switch_mlp.gate_proj": {
527
+ "group_size": 64,
528
+ "bits": 6
529
+ },
530
+ "model.layers.13.mlp.switch_mlp.up_proj": {
531
+ "group_size": 64,
532
+ "bits": 6
533
+ },
534
+ "model.layers.13.mlp.switch_mlp.down_proj": {
535
+ "group_size": 64,
536
+ "bits": 6
537
+ },
538
+ "model.layers.13.mlp.gate.gate_proj": {
539
+ "group_size": 64,
540
+ "bits": 6
541
+ },
542
+ "model.layers.13.mlp.shared_experts.gate_proj": {
543
+ "group_size": 32,
544
+ "bits": 8
545
+ },
546
+ "model.layers.13.mlp.shared_experts.down_proj": {
547
+ "group_size": 32,
548
+ "bits": 8
549
+ },
550
+ "model.layers.13.mlp.shared_experts.up_proj": {
551
+ "group_size": 32,
552
+ "bits": 8
553
+ },
554
+ "model.layers.14.attention.query_key_value": {
555
+ "group_size": 32,
556
+ "bits": 8
557
+ },
558
+ "model.layers.14.attention.dense": {
559
+ "group_size": 32,
560
+ "bits": 8
561
+ },
562
+ "model.layers.14.mlp.switch_mlp.gate_proj": {
563
+ "group_size": 64,
564
+ "bits": 6
565
+ },
566
+ "model.layers.14.mlp.switch_mlp.up_proj": {
567
+ "group_size": 64,
568
+ "bits": 6
569
+ },
570
+ "model.layers.14.mlp.switch_mlp.down_proj": {
571
+ "group_size": 64,
572
+ "bits": 6
573
+ },
574
+ "model.layers.14.mlp.gate.gate_proj": {
575
+ "group_size": 64,
576
+ "bits": 6
577
+ },
578
+ "model.layers.14.mlp.shared_experts.gate_proj": {
579
+ "group_size": 32,
580
+ "bits": 8
581
+ },
582
+ "model.layers.14.mlp.shared_experts.down_proj": {
583
+ "group_size": 32,
584
+ "bits": 8
585
+ },
586
+ "model.layers.14.mlp.shared_experts.up_proj": {
587
+ "group_size": 32,
588
+ "bits": 8
589
+ },
590
+ "model.layers.15.attention.query_key_value": {
591
+ "group_size": 32,
592
+ "bits": 8
593
+ },
594
+ "model.layers.15.attention.dense": {
595
+ "group_size": 32,
596
+ "bits": 8
597
+ },
598
+ "model.layers.15.mlp.switch_mlp.gate_proj": {
599
+ "group_size": 64,
600
+ "bits": 6
601
+ },
602
+ "model.layers.15.mlp.switch_mlp.up_proj": {
603
+ "group_size": 64,
604
+ "bits": 6
605
+ },
606
+ "model.layers.15.mlp.switch_mlp.down_proj": {
607
+ "group_size": 64,
608
+ "bits": 6
609
+ },
610
+ "model.layers.15.mlp.gate.gate_proj": {
611
+ "group_size": 64,
612
+ "bits": 6
613
+ },
614
+ "model.layers.15.mlp.shared_experts.gate_proj": {
615
+ "group_size": 32,
616
+ "bits": 8
617
+ },
618
+ "model.layers.15.mlp.shared_experts.down_proj": {
619
+ "group_size": 32,
620
+ "bits": 8
621
+ },
622
+ "model.layers.15.mlp.shared_experts.up_proj": {
623
+ "group_size": 32,
624
+ "bits": 8
625
+ },
626
+ "model.layers.16.attention.query_key_value": {
627
+ "group_size": 32,
628
+ "bits": 8
629
+ },
630
+ "model.layers.16.attention.dense": {
631
+ "group_size": 32,
632
+ "bits": 8
633
+ },
634
+ "model.layers.16.mlp.switch_mlp.gate_proj": {
635
+ "group_size": 64,
636
+ "bits": 6
637
+ },
638
+ "model.layers.16.mlp.switch_mlp.up_proj": {
639
+ "group_size": 64,
640
+ "bits": 6
641
+ },
642
+ "model.layers.16.mlp.switch_mlp.down_proj": {
643
+ "group_size": 64,
644
+ "bits": 6
645
+ },
646
+ "model.layers.16.mlp.gate.gate_proj": {
647
+ "group_size": 64,
648
+ "bits": 6
649
+ },
650
+ "model.layers.16.mlp.shared_experts.gate_proj": {
651
+ "group_size": 32,
652
+ "bits": 8
653
+ },
654
+ "model.layers.16.mlp.shared_experts.down_proj": {
655
+ "group_size": 32,
656
+ "bits": 8
657
+ },
658
+ "model.layers.16.mlp.shared_experts.up_proj": {
659
+ "group_size": 32,
660
+ "bits": 8
661
+ },
662
+ "model.layers.17.attention.query_key_value": {
663
+ "group_size": 32,
664
+ "bits": 8
665
+ },
666
+ "model.layers.17.attention.dense": {
667
+ "group_size": 32,
668
+ "bits": 8
669
+ },
670
+ "model.layers.17.mlp.switch_mlp.gate_proj": {
671
+ "group_size": 64,
672
+ "bits": 6
673
+ },
674
+ "model.layers.17.mlp.switch_mlp.up_proj": {
675
+ "group_size": 64,
676
+ "bits": 6
677
+ },
678
+ "model.layers.17.mlp.switch_mlp.down_proj": {
679
+ "group_size": 64,
680
+ "bits": 6
681
+ },
682
+ "model.layers.17.mlp.gate.gate_proj": {
683
+ "group_size": 64,
684
+ "bits": 6
685
+ },
686
+ "model.layers.17.mlp.shared_experts.gate_proj": {
687
+ "group_size": 32,
688
+ "bits": 8
689
+ },
690
+ "model.layers.17.mlp.shared_experts.down_proj": {
691
+ "group_size": 32,
692
+ "bits": 8
693
+ },
694
+ "model.layers.17.mlp.shared_experts.up_proj": {
695
+ "group_size": 32,
696
+ "bits": 8
697
+ },
698
+ "model.layers.18.attention.query_key_value": {
699
+ "group_size": 32,
700
+ "bits": 8
701
+ },
702
+ "model.layers.18.attention.dense": {
703
+ "group_size": 32,
704
+ "bits": 8
705
+ },
706
+ "model.layers.18.mlp.switch_mlp.gate_proj": {
707
+ "group_size": 64,
708
+ "bits": 6
709
+ },
710
+ "model.layers.18.mlp.switch_mlp.up_proj": {
711
+ "group_size": 64,
712
+ "bits": 6
713
+ },
714
+ "model.layers.18.mlp.switch_mlp.down_proj": {
715
+ "group_size": 64,
716
+ "bits": 6
717
+ },
718
+ "model.layers.18.mlp.gate.gate_proj": {
719
+ "group_size": 64,
720
+ "bits": 6
721
+ },
722
+ "model.layers.18.mlp.shared_experts.gate_proj": {
723
+ "group_size": 32,
724
+ "bits": 8
725
+ },
726
+ "model.layers.18.mlp.shared_experts.down_proj": {
727
+ "group_size": 32,
728
+ "bits": 8
729
+ },
730
+ "model.layers.18.mlp.shared_experts.up_proj": {
731
+ "group_size": 32,
732
+ "bits": 8
733
+ },
734
+ "model.layers.19.attention.query_key_value": {
735
+ "group_size": 32,
736
+ "bits": 8
737
+ },
738
+ "model.layers.19.attention.dense": {
739
+ "group_size": 32,
740
+ "bits": 8
741
+ },
742
+ "model.layers.19.mlp.switch_mlp.gate_proj": {
743
+ "group_size": 64,
744
+ "bits": 6
745
+ },
746
+ "model.layers.19.mlp.switch_mlp.up_proj": {
747
+ "group_size": 64,
748
+ "bits": 6
749
+ },
750
+ "model.layers.19.mlp.switch_mlp.down_proj": {
751
+ "group_size": 64,
752
+ "bits": 6
753
+ },
754
+ "model.layers.19.mlp.gate.gate_proj": {
755
+ "group_size": 64,
756
+ "bits": 6
757
+ },
758
+ "model.layers.19.mlp.shared_experts.gate_proj": {
759
+ "group_size": 32,
760
+ "bits": 8
761
+ },
762
+ "model.layers.19.mlp.shared_experts.down_proj": {
763
+ "group_size": 32,
764
+ "bits": 8
765
+ },
766
+ "model.layers.19.mlp.shared_experts.up_proj": {
767
+ "group_size": 32,
768
+ "bits": 8
769
+ },
770
+ "lm_head": {
771
+ "group_size": 32,
772
+ "bits": 8
773
+ }
774
+ },
775
+ "quantization_config": {
776
+ "group_size": 64,
777
+ "bits": 6,
778
+ "mode": "affine",
779
+ "model.word_embeddings": {
780
+ "group_size": 32,
781
+ "bits": 8
782
+ },
783
+ "model.layers.0.attention.query_key_value": {
784
+ "group_size": 32,
785
+ "bits": 8
786
+ },
787
+ "model.layers.0.attention.dense": {
788
+ "group_size": 32,
789
+ "bits": 8
790
+ },
791
+ "model.layers.0.mlp.gate_proj": {
792
+ "group_size": 32,
793
+ "bits": 8
794
+ },
795
+ "model.layers.0.mlp.down_proj": {
796
+ "group_size": 32,
797
+ "bits": 8
798
+ },
799
+ "model.layers.0.mlp.up_proj": {
800
+ "group_size": 32,
801
+ "bits": 8
802
+ },
803
+ "model.layers.1.attention.query_key_value": {
804
+ "group_size": 32,
805
+ "bits": 8
806
+ },
807
+ "model.layers.1.attention.dense": {
808
+ "group_size": 32,
809
+ "bits": 8
810
+ },
811
+ "model.layers.1.mlp.switch_mlp.gate_proj": {
812
+ "group_size": 32,
813
+ "bits": 8
814
+ },
815
+ "model.layers.1.mlp.switch_mlp.up_proj": {
816
+ "group_size": 32,
817
+ "bits": 8
818
+ },
819
+ "model.layers.1.mlp.switch_mlp.down_proj": {
820
+ "group_size": 32,
821
+ "bits": 8
822
+ },
823
+ "model.layers.1.mlp.gate.gate_proj": {
824
+ "group_size": 32,
825
+ "bits": 8
826
+ },
827
+ "model.layers.1.mlp.shared_experts.gate_proj": {
828
+ "group_size": 32,
829
+ "bits": 8
830
+ },
831
+ "model.layers.1.mlp.shared_experts.down_proj": {
832
+ "group_size": 32,
833
+ "bits": 8
834
+ },
835
+ "model.layers.1.mlp.shared_experts.up_proj": {
836
+ "group_size": 32,
837
+ "bits": 8
838
+ },
839
+ "model.layers.2.attention.query_key_value": {
840
+ "group_size": 32,
841
+ "bits": 8
842
+ },
843
+ "model.layers.2.attention.dense": {
844
+ "group_size": 32,
845
+ "bits": 8
846
+ },
847
+ "model.layers.2.mlp.switch_mlp.gate_proj": {
848
+ "group_size": 64,
849
+ "bits": 6
850
+ },
851
+ "model.layers.2.mlp.switch_mlp.up_proj": {
852
+ "group_size": 64,
853
+ "bits": 6
854
+ },
855
+ "model.layers.2.mlp.switch_mlp.down_proj": {
856
+ "group_size": 64,
857
+ "bits": 6
858
+ },
859
+ "model.layers.2.mlp.gate.gate_proj": {
860
+ "group_size": 64,
861
+ "bits": 6
862
+ },
863
+ "model.layers.2.mlp.shared_experts.gate_proj": {
864
+ "group_size": 32,
865
+ "bits": 8
866
+ },
867
+ "model.layers.2.mlp.shared_experts.down_proj": {
868
+ "group_size": 32,
869
+ "bits": 8
870
+ },
871
+ "model.layers.2.mlp.shared_experts.up_proj": {
872
+ "group_size": 32,
873
+ "bits": 8
874
+ },
875
+ "model.layers.3.attention.query_key_value": {
876
+ "group_size": 32,
877
+ "bits": 8
878
+ },
879
+ "model.layers.3.attention.dense": {
880
+ "group_size": 32,
881
+ "bits": 8
882
+ },
883
+ "model.layers.3.mlp.switch_mlp.gate_proj": {
884
+ "group_size": 64,
885
+ "bits": 6
886
+ },
887
+ "model.layers.3.mlp.switch_mlp.up_proj": {
888
+ "group_size": 64,
889
+ "bits": 6
890
+ },
891
+ "model.layers.3.mlp.switch_mlp.down_proj": {
892
+ "group_size": 64,
893
+ "bits": 6
894
+ },
895
+ "model.layers.3.mlp.gate.gate_proj": {
896
+ "group_size": 64,
897
+ "bits": 6
898
+ },
899
+ "model.layers.3.mlp.shared_experts.gate_proj": {
900
+ "group_size": 32,
901
+ "bits": 8
902
+ },
903
+ "model.layers.3.mlp.shared_experts.down_proj": {
904
+ "group_size": 32,
905
+ "bits": 8
906
+ },
907
+ "model.layers.3.mlp.shared_experts.up_proj": {
908
+ "group_size": 32,
909
+ "bits": 8
910
+ },
911
+ "model.layers.4.attention.query_key_value": {
912
+ "group_size": 32,
913
+ "bits": 8
914
+ },
915
+ "model.layers.4.attention.dense": {
916
+ "group_size": 32,
917
+ "bits": 8
918
+ },
919
+ "model.layers.4.mlp.switch_mlp.gate_proj": {
920
+ "group_size": 64,
921
+ "bits": 6
922
+ },
923
+ "model.layers.4.mlp.switch_mlp.up_proj": {
924
+ "group_size": 64,
925
+ "bits": 6
926
+ },
927
+ "model.layers.4.mlp.switch_mlp.down_proj": {
928
+ "group_size": 64,
929
+ "bits": 6
930
+ },
931
+ "model.layers.4.mlp.gate.gate_proj": {
932
+ "group_size": 64,
933
+ "bits": 6
934
+ },
935
+ "model.layers.4.mlp.shared_experts.gate_proj": {
936
+ "group_size": 32,
937
+ "bits": 8
938
+ },
939
+ "model.layers.4.mlp.shared_experts.down_proj": {
940
+ "group_size": 32,
941
+ "bits": 8
942
+ },
943
+ "model.layers.4.mlp.shared_experts.up_proj": {
944
+ "group_size": 32,
945
+ "bits": 8
946
+ },
947
+ "model.layers.5.attention.query_key_value": {
948
+ "group_size": 32,
949
+ "bits": 8
950
+ },
951
+ "model.layers.5.attention.dense": {
952
+ "group_size": 32,
953
+ "bits": 8
954
+ },
955
+ "model.layers.5.mlp.switch_mlp.gate_proj": {
956
+ "group_size": 64,
957
+ "bits": 6
958
+ },
959
+ "model.layers.5.mlp.switch_mlp.up_proj": {
960
+ "group_size": 64,
961
+ "bits": 6
962
+ },
963
+ "model.layers.5.mlp.switch_mlp.down_proj": {
964
+ "group_size": 64,
965
+ "bits": 6
966
+ },
967
+ "model.layers.5.mlp.gate.gate_proj": {
968
+ "group_size": 64,
969
+ "bits": 6
970
+ },
971
+ "model.layers.5.mlp.shared_experts.gate_proj": {
972
+ "group_size": 32,
973
+ "bits": 8
974
+ },
975
+ "model.layers.5.mlp.shared_experts.down_proj": {
976
+ "group_size": 32,
977
+ "bits": 8
978
+ },
979
+ "model.layers.5.mlp.shared_experts.up_proj": {
980
+ "group_size": 32,
981
+ "bits": 8
982
+ },
983
+ "model.layers.6.attention.query_key_value": {
984
+ "group_size": 32,
985
+ "bits": 8
986
+ },
987
+ "model.layers.6.attention.dense": {
988
+ "group_size": 32,
989
+ "bits": 8
990
+ },
991
+ "model.layers.6.mlp.switch_mlp.gate_proj": {
992
+ "group_size": 64,
993
+ "bits": 6
994
+ },
995
+ "model.layers.6.mlp.switch_mlp.up_proj": {
996
+ "group_size": 64,
997
+ "bits": 6
998
+ },
999
+ "model.layers.6.mlp.switch_mlp.down_proj": {
1000
+ "group_size": 64,
1001
+ "bits": 6
1002
+ },
1003
+ "model.layers.6.mlp.gate.gate_proj": {
1004
+ "group_size": 64,
1005
+ "bits": 6
1006
+ },
1007
+ "model.layers.6.mlp.shared_experts.gate_proj": {
1008
+ "group_size": 32,
1009
+ "bits": 8
1010
+ },
1011
+ "model.layers.6.mlp.shared_experts.down_proj": {
1012
+ "group_size": 32,
1013
+ "bits": 8
1014
+ },
1015
+ "model.layers.6.mlp.shared_experts.up_proj": {
1016
+ "group_size": 32,
1017
+ "bits": 8
1018
+ },
1019
+ "model.layers.7.attention.query_key_value": {
1020
+ "group_size": 32,
1021
+ "bits": 8
1022
+ },
1023
+ "model.layers.7.attention.dense": {
1024
+ "group_size": 32,
1025
+ "bits": 8
1026
+ },
1027
+ "model.layers.7.mlp.switch_mlp.gate_proj": {
1028
+ "group_size": 64,
1029
+ "bits": 6
1030
+ },
1031
+ "model.layers.7.mlp.switch_mlp.up_proj": {
1032
+ "group_size": 64,
1033
+ "bits": 6
1034
+ },
1035
+ "model.layers.7.mlp.switch_mlp.down_proj": {
1036
+ "group_size": 64,
1037
+ "bits": 6
1038
+ },
1039
+ "model.layers.7.mlp.gate.gate_proj": {
1040
+ "group_size": 64,
1041
+ "bits": 6
1042
+ },
1043
+ "model.layers.7.mlp.shared_experts.gate_proj": {
1044
+ "group_size": 32,
1045
+ "bits": 8
1046
+ },
1047
+ "model.layers.7.mlp.shared_experts.down_proj": {
1048
+ "group_size": 32,
1049
+ "bits": 8
1050
+ },
1051
+ "model.layers.7.mlp.shared_experts.up_proj": {
1052
+ "group_size": 32,
1053
+ "bits": 8
1054
+ },
1055
+ "model.layers.8.attention.query_key_value": {
1056
+ "group_size": 32,
1057
+ "bits": 8
1058
+ },
1059
+ "model.layers.8.attention.dense": {
1060
+ "group_size": 32,
1061
+ "bits": 8
1062
+ },
1063
+ "model.layers.8.mlp.switch_mlp.gate_proj": {
1064
+ "group_size": 64,
1065
+ "bits": 6
1066
+ },
1067
+ "model.layers.8.mlp.switch_mlp.up_proj": {
1068
+ "group_size": 64,
1069
+ "bits": 6
1070
+ },
1071
+ "model.layers.8.mlp.switch_mlp.down_proj": {
1072
+ "group_size": 64,
1073
+ "bits": 6
1074
+ },
1075
+ "model.layers.8.mlp.gate.gate_proj": {
1076
+ "group_size": 64,
1077
+ "bits": 6
1078
+ },
1079
+ "model.layers.8.mlp.shared_experts.gate_proj": {
1080
+ "group_size": 32,
1081
+ "bits": 8
1082
+ },
1083
+ "model.layers.8.mlp.shared_experts.down_proj": {
1084
+ "group_size": 32,
1085
+ "bits": 8
1086
+ },
1087
+ "model.layers.8.mlp.shared_experts.up_proj": {
1088
+ "group_size": 32,
1089
+ "bits": 8
1090
+ },
1091
+ "model.layers.9.attention.query_key_value": {
1092
+ "group_size": 32,
1093
+ "bits": 8
1094
+ },
1095
+ "model.layers.9.attention.dense": {
1096
+ "group_size": 32,
1097
+ "bits": 8
1098
+ },
1099
+ "model.layers.9.mlp.switch_mlp.gate_proj": {
1100
+ "group_size": 64,
1101
+ "bits": 6
1102
+ },
1103
+ "model.layers.9.mlp.switch_mlp.up_proj": {
1104
+ "group_size": 64,
1105
+ "bits": 6
1106
+ },
1107
+ "model.layers.9.mlp.switch_mlp.down_proj": {
1108
+ "group_size": 64,
1109
+ "bits": 6
1110
+ },
1111
+ "model.layers.9.mlp.gate.gate_proj": {
1112
+ "group_size": 64,
1113
+ "bits": 6
1114
+ },
1115
+ "model.layers.9.mlp.shared_experts.gate_proj": {
1116
+ "group_size": 32,
1117
+ "bits": 8
1118
+ },
1119
+ "model.layers.9.mlp.shared_experts.down_proj": {
1120
+ "group_size": 32,
1121
+ "bits": 8
1122
+ },
1123
+ "model.layers.9.mlp.shared_experts.up_proj": {
1124
+ "group_size": 32,
1125
+ "bits": 8
1126
+ },
1127
+ "model.layers.10.attention.query_key_value": {
1128
+ "group_size": 32,
1129
+ "bits": 8
1130
+ },
1131
+ "model.layers.10.attention.dense": {
1132
+ "group_size": 32,
1133
+ "bits": 8
1134
+ },
1135
+ "model.layers.10.mlp.switch_mlp.gate_proj": {
1136
+ "group_size": 64,
1137
+ "bits": 6
1138
+ },
1139
+ "model.layers.10.mlp.switch_mlp.up_proj": {
1140
+ "group_size": 64,
1141
+ "bits": 6
1142
+ },
1143
+ "model.layers.10.mlp.switch_mlp.down_proj": {
1144
+ "group_size": 64,
1145
+ "bits": 6
1146
+ },
1147
+ "model.layers.10.mlp.gate.gate_proj": {
1148
+ "group_size": 64,
1149
+ "bits": 6
1150
+ },
1151
+ "model.layers.10.mlp.shared_experts.gate_proj": {
1152
+ "group_size": 32,
1153
+ "bits": 8
1154
+ },
1155
+ "model.layers.10.mlp.shared_experts.down_proj": {
1156
+ "group_size": 32,
1157
+ "bits": 8
1158
+ },
1159
+ "model.layers.10.mlp.shared_experts.up_proj": {
1160
+ "group_size": 32,
1161
+ "bits": 8
1162
+ },
1163
+ "model.layers.11.attention.query_key_value": {
1164
+ "group_size": 32,
1165
+ "bits": 8
1166
+ },
1167
+ "model.layers.11.attention.dense": {
1168
+ "group_size": 32,
1169
+ "bits": 8
1170
+ },
1171
+ "model.layers.11.mlp.switch_mlp.gate_proj": {
1172
+ "group_size": 64,
1173
+ "bits": 6
1174
+ },
1175
+ "model.layers.11.mlp.switch_mlp.up_proj": {
1176
+ "group_size": 64,
1177
+ "bits": 6
1178
+ },
1179
+ "model.layers.11.mlp.switch_mlp.down_proj": {
1180
+ "group_size": 64,
1181
+ "bits": 6
1182
+ },
1183
+ "model.layers.11.mlp.gate.gate_proj": {
1184
+ "group_size": 64,
1185
+ "bits": 6
1186
+ },
1187
+ "model.layers.11.mlp.shared_experts.gate_proj": {
1188
+ "group_size": 32,
1189
+ "bits": 8
1190
+ },
1191
+ "model.layers.11.mlp.shared_experts.down_proj": {
1192
+ "group_size": 32,
1193
+ "bits": 8
1194
+ },
1195
+ "model.layers.11.mlp.shared_experts.up_proj": {
1196
+ "group_size": 32,
1197
+ "bits": 8
1198
+ },
1199
+ "model.layers.12.attention.query_key_value": {
1200
+ "group_size": 32,
1201
+ "bits": 8
1202
+ },
1203
+ "model.layers.12.attention.dense": {
1204
+ "group_size": 32,
1205
+ "bits": 8
1206
+ },
1207
+ "model.layers.12.mlp.switch_mlp.gate_proj": {
1208
+ "group_size": 64,
1209
+ "bits": 6
1210
+ },
1211
+ "model.layers.12.mlp.switch_mlp.up_proj": {
1212
+ "group_size": 64,
1213
+ "bits": 6
1214
+ },
1215
+ "model.layers.12.mlp.switch_mlp.down_proj": {
1216
+ "group_size": 64,
1217
+ "bits": 6
1218
+ },
1219
+ "model.layers.12.mlp.gate.gate_proj": {
1220
+ "group_size": 64,
1221
+ "bits": 6
1222
+ },
1223
+ "model.layers.12.mlp.shared_experts.gate_proj": {
1224
+ "group_size": 32,
1225
+ "bits": 8
1226
+ },
1227
+ "model.layers.12.mlp.shared_experts.down_proj": {
1228
+ "group_size": 32,
1229
+ "bits": 8
1230
+ },
1231
+ "model.layers.12.mlp.shared_experts.up_proj": {
1232
+ "group_size": 32,
1233
+ "bits": 8
1234
+ },
1235
+ "model.layers.13.attention.query_key_value": {
1236
+ "group_size": 32,
1237
+ "bits": 8
1238
+ },
1239
+ "model.layers.13.attention.dense": {
1240
+ "group_size": 32,
1241
+ "bits": 8
1242
+ },
1243
+ "model.layers.13.mlp.switch_mlp.gate_proj": {
1244
+ "group_size": 64,
1245
+ "bits": 6
1246
+ },
1247
+ "model.layers.13.mlp.switch_mlp.up_proj": {
1248
+ "group_size": 64,
1249
+ "bits": 6
1250
+ },
1251
+ "model.layers.13.mlp.switch_mlp.down_proj": {
1252
+ "group_size": 64,
1253
+ "bits": 6
1254
+ },
1255
+ "model.layers.13.mlp.gate.gate_proj": {
1256
+ "group_size": 64,
1257
+ "bits": 6
1258
+ },
1259
+ "model.layers.13.mlp.shared_experts.gate_proj": {
1260
+ "group_size": 32,
1261
+ "bits": 8
1262
+ },
1263
+ "model.layers.13.mlp.shared_experts.down_proj": {
1264
+ "group_size": 32,
1265
+ "bits": 8
1266
+ },
1267
+ "model.layers.13.mlp.shared_experts.up_proj": {
1268
+ "group_size": 32,
1269
+ "bits": 8
1270
+ },
1271
+ "model.layers.14.attention.query_key_value": {
1272
+ "group_size": 32,
1273
+ "bits": 8
1274
+ },
1275
+ "model.layers.14.attention.dense": {
1276
+ "group_size": 32,
1277
+ "bits": 8
1278
+ },
1279
+ "model.layers.14.mlp.switch_mlp.gate_proj": {
1280
+ "group_size": 64,
1281
+ "bits": 6
1282
+ },
1283
+ "model.layers.14.mlp.switch_mlp.up_proj": {
1284
+ "group_size": 64,
1285
+ "bits": 6
1286
+ },
1287
+ "model.layers.14.mlp.switch_mlp.down_proj": {
1288
+ "group_size": 64,
1289
+ "bits": 6
1290
+ },
1291
+ "model.layers.14.mlp.gate.gate_proj": {
1292
+ "group_size": 64,
1293
+ "bits": 6
1294
+ },
1295
+ "model.layers.14.mlp.shared_experts.gate_proj": {
1296
+ "group_size": 32,
1297
+ "bits": 8
1298
+ },
1299
+ "model.layers.14.mlp.shared_experts.down_proj": {
1300
+ "group_size": 32,
1301
+ "bits": 8
1302
+ },
1303
+ "model.layers.14.mlp.shared_experts.up_proj": {
1304
+ "group_size": 32,
1305
+ "bits": 8
1306
+ },
1307
+ "model.layers.15.attention.query_key_value": {
1308
+ "group_size": 32,
1309
+ "bits": 8
1310
+ },
1311
+ "model.layers.15.attention.dense": {
1312
+ "group_size": 32,
1313
+ "bits": 8
1314
+ },
1315
+ "model.layers.15.mlp.switch_mlp.gate_proj": {
1316
+ "group_size": 64,
1317
+ "bits": 6
1318
+ },
1319
+ "model.layers.15.mlp.switch_mlp.up_proj": {
1320
+ "group_size": 64,
1321
+ "bits": 6
1322
+ },
1323
+ "model.layers.15.mlp.switch_mlp.down_proj": {
1324
+ "group_size": 64,
1325
+ "bits": 6
1326
+ },
1327
+ "model.layers.15.mlp.gate.gate_proj": {
1328
+ "group_size": 64,
1329
+ "bits": 6
1330
+ },
1331
+ "model.layers.15.mlp.shared_experts.gate_proj": {
1332
+ "group_size": 32,
1333
+ "bits": 8
1334
+ },
1335
+ "model.layers.15.mlp.shared_experts.down_proj": {
1336
+ "group_size": 32,
1337
+ "bits": 8
1338
+ },
1339
+ "model.layers.15.mlp.shared_experts.up_proj": {
1340
+ "group_size": 32,
1341
+ "bits": 8
1342
+ },
1343
+ "model.layers.16.attention.query_key_value": {
1344
+ "group_size": 32,
1345
+ "bits": 8
1346
+ },
1347
+ "model.layers.16.attention.dense": {
1348
+ "group_size": 32,
1349
+ "bits": 8
1350
+ },
1351
+ "model.layers.16.mlp.switch_mlp.gate_proj": {
1352
+ "group_size": 64,
1353
+ "bits": 6
1354
+ },
1355
+ "model.layers.16.mlp.switch_mlp.up_proj": {
1356
+ "group_size": 64,
1357
+ "bits": 6
1358
+ },
1359
+ "model.layers.16.mlp.switch_mlp.down_proj": {
1360
+ "group_size": 64,
1361
+ "bits": 6
1362
+ },
1363
+ "model.layers.16.mlp.gate.gate_proj": {
1364
+ "group_size": 64,
1365
+ "bits": 6
1366
+ },
1367
+ "model.layers.16.mlp.shared_experts.gate_proj": {
1368
+ "group_size": 32,
1369
+ "bits": 8
1370
+ },
1371
+ "model.layers.16.mlp.shared_experts.down_proj": {
1372
+ "group_size": 32,
1373
+ "bits": 8
1374
+ },
1375
+ "model.layers.16.mlp.shared_experts.up_proj": {
1376
+ "group_size": 32,
1377
+ "bits": 8
1378
+ },
1379
+ "model.layers.17.attention.query_key_value": {
1380
+ "group_size": 32,
1381
+ "bits": 8
1382
+ },
1383
+ "model.layers.17.attention.dense": {
1384
+ "group_size": 32,
1385
+ "bits": 8
1386
+ },
1387
+ "model.layers.17.mlp.switch_mlp.gate_proj": {
1388
+ "group_size": 64,
1389
+ "bits": 6
1390
+ },
1391
+ "model.layers.17.mlp.switch_mlp.up_proj": {
1392
+ "group_size": 64,
1393
+ "bits": 6
1394
+ },
1395
+ "model.layers.17.mlp.switch_mlp.down_proj": {
1396
+ "group_size": 64,
1397
+ "bits": 6
1398
+ },
1399
+ "model.layers.17.mlp.gate.gate_proj": {
1400
+ "group_size": 64,
1401
+ "bits": 6
1402
+ },
1403
+ "model.layers.17.mlp.shared_experts.gate_proj": {
1404
+ "group_size": 32,
1405
+ "bits": 8
1406
+ },
1407
+ "model.layers.17.mlp.shared_experts.down_proj": {
1408
+ "group_size": 32,
1409
+ "bits": 8
1410
+ },
1411
+ "model.layers.17.mlp.shared_experts.up_proj": {
1412
+ "group_size": 32,
1413
+ "bits": 8
1414
+ },
1415
+ "model.layers.18.attention.query_key_value": {
1416
+ "group_size": 32,
1417
+ "bits": 8
1418
+ },
1419
+ "model.layers.18.attention.dense": {
1420
+ "group_size": 32,
1421
+ "bits": 8
1422
+ },
1423
+ "model.layers.18.mlp.switch_mlp.gate_proj": {
1424
+ "group_size": 64,
1425
+ "bits": 6
1426
+ },
1427
+ "model.layers.18.mlp.switch_mlp.up_proj": {
1428
+ "group_size": 64,
1429
+ "bits": 6
1430
+ },
1431
+ "model.layers.18.mlp.switch_mlp.down_proj": {
1432
+ "group_size": 64,
1433
+ "bits": 6
1434
+ },
1435
+ "model.layers.18.mlp.gate.gate_proj": {
1436
+ "group_size": 64,
1437
+ "bits": 6
1438
+ },
1439
+ "model.layers.18.mlp.shared_experts.gate_proj": {
1440
+ "group_size": 32,
1441
+ "bits": 8
1442
+ },
1443
+ "model.layers.18.mlp.shared_experts.down_proj": {
1444
+ "group_size": 32,
1445
+ "bits": 8
1446
+ },
1447
+ "model.layers.18.mlp.shared_experts.up_proj": {
1448
+ "group_size": 32,
1449
+ "bits": 8
1450
+ },
1451
+ "model.layers.19.attention.query_key_value": {
1452
+ "group_size": 32,
1453
+ "bits": 8
1454
+ },
1455
+ "model.layers.19.attention.dense": {
1456
+ "group_size": 32,
1457
+ "bits": 8
1458
+ },
1459
+ "model.layers.19.mlp.switch_mlp.gate_proj": {
1460
+ "group_size": 64,
1461
+ "bits": 6
1462
+ },
1463
+ "model.layers.19.mlp.switch_mlp.up_proj": {
1464
+ "group_size": 64,
1465
+ "bits": 6
1466
+ },
1467
+ "model.layers.19.mlp.switch_mlp.down_proj": {
1468
+ "group_size": 64,
1469
+ "bits": 6
1470
+ },
1471
+ "model.layers.19.mlp.gate.gate_proj": {
1472
+ "group_size": 64,
1473
+ "bits": 6
1474
+ },
1475
+ "model.layers.19.mlp.shared_experts.gate_proj": {
1476
+ "group_size": 32,
1477
+ "bits": 8
1478
+ },
1479
+ "model.layers.19.mlp.shared_experts.down_proj": {
1480
+ "group_size": 32,
1481
+ "bits": 8
1482
+ },
1483
+ "model.layers.19.mlp.shared_experts.up_proj": {
1484
+ "group_size": 32,
1485
+ "bits": 8
1486
+ },
1487
+ "lm_head": {
1488
+ "group_size": 32,
1489
+ "bits": 8
1490
+ }
1491
+ },
1492
+ "rms_norm_eps": 1e-06,
1493
+ "rope_scaling": null,
1494
+ "rope_theta": 600000,
1495
+ "routed_scaling_factor": 2.5,
1496
+ "router_dtype": "fp32",
1497
+ "score_function": "sigmoid",
1498
+ "tie_word_embeddings": false,
1499
+ "topk_group": 4,
1500
+ "torch_dtype": "bfloat16",
1501
+ "transformers_version": "4.52.3",
1502
+ "use_bias": false,
1503
+ "use_cache": true,
1504
+ "use_moba_decode": true,
1505
+ "use_qk_norm": true,
1506
+ "use_qkv_bias": false,
1507
+ "use_rmsnorm": true,
1508
+ "vocab_size": 157184
1509
+ }
configuration_bailing_moe_v2.py ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Bailing MoE V2 model configuration"""
2
+
3
+ from transformers.configuration_utils import PretrainedConfig
4
+
5
+
6
+ class BailingMoeV2Config(PretrainedConfig):
7
+
8
+ def __init__(
9
+ self,
10
+ vocab_size=157184,
11
+ hidden_size=2048,
12
+ intermediate_size=5120,
13
+ num_hidden_layers=20,
14
+ num_attention_heads=16,
15
+ num_key_value_heads=4,
16
+ hidden_act="silu",
17
+ use_qkv_bias=False, # bailing only
18
+ use_bias=False, # bailing only
19
+ rms_norm_eps=1e-06,
20
+ tie_word_embeddings=False, # PretrainedConfig key, here change default value.
21
+ embedding_dropout=0.0,
22
+ attention_dropout=0.0,
23
+ output_dropout=0.0,
24
+ initializer_range=0.02,
25
+ max_position_embeddings=32768,
26
+ rope_theta=600000.0,
27
+ use_cache=True,
28
+ max_window_layers=20,
29
+ rope_scaling=None,
30
+ pad_token_id=156892,
31
+ eos_token_id=156892,
32
+ num_experts=256,
33
+ num_shared_experts=1,
34
+ num_experts_per_tok=8,
35
+ n_group=8,
36
+ topk_group=4,
37
+ moe_intermediate_size=512,
38
+ first_k_dense_replace=1,
39
+ head_dim=128,
40
+ output_router_logits=False,
41
+ use_qk_norm=True,
42
+ num_nextn_predict_layers=0,
43
+ mtp_loss_scaling_factor=0,
44
+ moe_router_enable_expert_bias=True,
45
+ routed_scaling_factor=1.0,
46
+ **kwargs,
47
+ ):
48
+ self.num_hidden_layers = num_hidden_layers
49
+ self.vocab_size = vocab_size
50
+ self.hidden_size = hidden_size
51
+ self.intermediate_size = intermediate_size
52
+ self.num_attention_heads = num_attention_heads
53
+ self.num_key_value_heads = num_key_value_heads
54
+ self.hidden_act = hidden_act
55
+ self.use_qkv_bias = use_qkv_bias
56
+ self.use_bias = use_bias
57
+ self.rms_norm_eps = rms_norm_eps
58
+ self.embedding_dropout = embedding_dropout
59
+ self.attention_dropout = attention_dropout
60
+ self.output_dropout = output_dropout
61
+ self.num_nextn_predict_layers = num_nextn_predict_layers
62
+ self.mtp_loss_scaling_factor = mtp_loss_scaling_factor
63
+ self.initializer_range = initializer_range
64
+ self.max_position_embeddings = max_position_embeddings
65
+ self.rope_theta = rope_theta
66
+ self.use_cache = use_cache
67
+ self.max_window_layers = max_window_layers
68
+ self.head_dim = head_dim or self.hidden_size // self.num_attention_heads
69
+ self.rope_scaling = rope_scaling
70
+ self.use_qk_norm = use_qk_norm
71
+ self.moe_router_enable_expert_bias = moe_router_enable_expert_bias
72
+ self.routed_scaling_factor = routed_scaling_factor
73
+
74
+ # MoE configs
75
+ self.num_experts = num_experts
76
+ self.num_shared_experts = num_shared_experts
77
+ self.num_experts_per_tok = num_experts_per_tok
78
+ self.n_group = n_group
79
+ self.topk_group = topk_group
80
+ self.moe_intermediate_size = moe_intermediate_size
81
+ self.first_k_dense_replace = first_k_dense_replace
82
+ self.output_router_logits = output_router_logits
83
+
84
+ super().__init__(pad_token_id=pad_token_id, eos_token_id=eos_token_id, tie_word_embeddings=tie_word_embeddings, **kwargs)
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 156891,
3
+ "eos_token_id": [
4
+ 156892,
5
+ 156895
6
+ ],
7
+ "pad_token_id": 156892,
8
+ "transformers_version": "4.56.1"
9
+ }
model-00001-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b93f698d89b80fafc9867cf4832726c7a17448c2f226df02c343210bab04fc84
3
+ size 5363574071
model-00002-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6740a69c7d229a31289fa6f87ce13182b2950de63f3dffde90b24735348bd18f
3
+ size 5360691672
model-00003-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7617c930c16c633c6d3f498f8bc3f2cc470e88b77d8d15e87518eafcb2c110fb
3
+ size 3030704346
model.safetensors.index.json ADDED
@@ -0,0 +1,642 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 13754893312,
4
+ "total_parameters": 16255638528
5
+ },
6
+ "weight_map": {
7
+ "lm_head.biases": "model-00003-of-00003.safetensors",
8
+ "lm_head.scales": "model-00003-of-00003.safetensors",
9
+ "lm_head.weight": "model-00003-of-00003.safetensors",
10
+ "model.layers.0.attention.dense.biases": "model-00001-of-00003.safetensors",
11
+ "model.layers.0.attention.dense.scales": "model-00001-of-00003.safetensors",
12
+ "model.layers.0.attention.dense.weight": "model-00001-of-00003.safetensors",
13
+ "model.layers.0.attention.key_layernorm.weight": "model-00001-of-00003.safetensors",
14
+ "model.layers.0.attention.query_key_value.biases": "model-00001-of-00003.safetensors",
15
+ "model.layers.0.attention.query_key_value.scales": "model-00001-of-00003.safetensors",
16
+ "model.layers.0.attention.query_key_value.weight": "model-00001-of-00003.safetensors",
17
+ "model.layers.0.attention.query_layernorm.weight": "model-00001-of-00003.safetensors",
18
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00003.safetensors",
19
+ "model.layers.0.mlp.down_proj.biases": "model-00001-of-00003.safetensors",
20
+ "model.layers.0.mlp.down_proj.scales": "model-00001-of-00003.safetensors",
21
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00003.safetensors",
22
+ "model.layers.0.mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
23
+ "model.layers.0.mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
24
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
25
+ "model.layers.0.mlp.up_proj.biases": "model-00001-of-00003.safetensors",
26
+ "model.layers.0.mlp.up_proj.scales": "model-00001-of-00003.safetensors",
27
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00003.safetensors",
28
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
29
+ "model.layers.1.attention.dense.biases": "model-00001-of-00003.safetensors",
30
+ "model.layers.1.attention.dense.scales": "model-00001-of-00003.safetensors",
31
+ "model.layers.1.attention.dense.weight": "model-00001-of-00003.safetensors",
32
+ "model.layers.1.attention.key_layernorm.weight": "model-00001-of-00003.safetensors",
33
+ "model.layers.1.attention.query_key_value.biases": "model-00001-of-00003.safetensors",
34
+ "model.layers.1.attention.query_key_value.scales": "model-00001-of-00003.safetensors",
35
+ "model.layers.1.attention.query_key_value.weight": "model-00001-of-00003.safetensors",
36
+ "model.layers.1.attention.query_layernorm.weight": "model-00001-of-00003.safetensors",
37
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00003.safetensors",
38
+ "model.layers.1.mlp.gate.expert_bias": "model-00001-of-00003.safetensors",
39
+ "model.layers.1.mlp.gate.gate_proj.biases": "model-00001-of-00003.safetensors",
40
+ "model.layers.1.mlp.gate.gate_proj.scales": "model-00001-of-00003.safetensors",
41
+ "model.layers.1.mlp.gate.gate_proj.weight": "model-00001-of-00003.safetensors",
42
+ "model.layers.1.mlp.shared_experts.down_proj.biases": "model-00001-of-00003.safetensors",
43
+ "model.layers.1.mlp.shared_experts.down_proj.scales": "model-00001-of-00003.safetensors",
44
+ "model.layers.1.mlp.shared_experts.down_proj.weight": "model-00001-of-00003.safetensors",
45
+ "model.layers.1.mlp.shared_experts.gate_proj.biases": "model-00001-of-00003.safetensors",
46
+ "model.layers.1.mlp.shared_experts.gate_proj.scales": "model-00001-of-00003.safetensors",
47
+ "model.layers.1.mlp.shared_experts.gate_proj.weight": "model-00001-of-00003.safetensors",
48
+ "model.layers.1.mlp.shared_experts.up_proj.biases": "model-00001-of-00003.safetensors",
49
+ "model.layers.1.mlp.shared_experts.up_proj.scales": "model-00001-of-00003.safetensors",
50
+ "model.layers.1.mlp.shared_experts.up_proj.weight": "model-00001-of-00003.safetensors",
51
+ "model.layers.1.mlp.switch_mlp.down_proj.biases": "model-00001-of-00003.safetensors",
52
+ "model.layers.1.mlp.switch_mlp.down_proj.scales": "model-00001-of-00003.safetensors",
53
+ "model.layers.1.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
54
+ "model.layers.1.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
55
+ "model.layers.1.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
56
+ "model.layers.1.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
57
+ "model.layers.1.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
58
+ "model.layers.1.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
59
+ "model.layers.1.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
60
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
61
+ "model.layers.10.attention.dense.biases": "model-00002-of-00003.safetensors",
62
+ "model.layers.10.attention.dense.scales": "model-00002-of-00003.safetensors",
63
+ "model.layers.10.attention.dense.weight": "model-00002-of-00003.safetensors",
64
+ "model.layers.10.attention.key_layernorm.weight": "model-00002-of-00003.safetensors",
65
+ "model.layers.10.attention.query_key_value.biases": "model-00002-of-00003.safetensors",
66
+ "model.layers.10.attention.query_key_value.scales": "model-00002-of-00003.safetensors",
67
+ "model.layers.10.attention.query_key_value.weight": "model-00002-of-00003.safetensors",
68
+ "model.layers.10.attention.query_layernorm.weight": "model-00002-of-00003.safetensors",
69
+ "model.layers.10.input_layernorm.weight": "model-00002-of-00003.safetensors",
70
+ "model.layers.10.mlp.gate.expert_bias": "model-00002-of-00003.safetensors",
71
+ "model.layers.10.mlp.gate.gate_proj.biases": "model-00002-of-00003.safetensors",
72
+ "model.layers.10.mlp.gate.gate_proj.scales": "model-00002-of-00003.safetensors",
73
+ "model.layers.10.mlp.gate.gate_proj.weight": "model-00002-of-00003.safetensors",
74
+ "model.layers.10.mlp.shared_experts.down_proj.biases": "model-00002-of-00003.safetensors",
75
+ "model.layers.10.mlp.shared_experts.down_proj.scales": "model-00002-of-00003.safetensors",
76
+ "model.layers.10.mlp.shared_experts.down_proj.weight": "model-00002-of-00003.safetensors",
77
+ "model.layers.10.mlp.shared_experts.gate_proj.biases": "model-00002-of-00003.safetensors",
78
+ "model.layers.10.mlp.shared_experts.gate_proj.scales": "model-00002-of-00003.safetensors",
79
+ "model.layers.10.mlp.shared_experts.gate_proj.weight": "model-00002-of-00003.safetensors",
80
+ "model.layers.10.mlp.shared_experts.up_proj.biases": "model-00002-of-00003.safetensors",
81
+ "model.layers.10.mlp.shared_experts.up_proj.scales": "model-00002-of-00003.safetensors",
82
+ "model.layers.10.mlp.shared_experts.up_proj.weight": "model-00002-of-00003.safetensors",
83
+ "model.layers.10.mlp.switch_mlp.down_proj.biases": "model-00002-of-00003.safetensors",
84
+ "model.layers.10.mlp.switch_mlp.down_proj.scales": "model-00002-of-00003.safetensors",
85
+ "model.layers.10.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
86
+ "model.layers.10.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
87
+ "model.layers.10.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
88
+ "model.layers.10.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
89
+ "model.layers.10.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
90
+ "model.layers.10.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
91
+ "model.layers.10.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
92
+ "model.layers.10.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
93
+ "model.layers.11.attention.dense.biases": "model-00002-of-00003.safetensors",
94
+ "model.layers.11.attention.dense.scales": "model-00002-of-00003.safetensors",
95
+ "model.layers.11.attention.dense.weight": "model-00002-of-00003.safetensors",
96
+ "model.layers.11.attention.key_layernorm.weight": "model-00002-of-00003.safetensors",
97
+ "model.layers.11.attention.query_key_value.biases": "model-00002-of-00003.safetensors",
98
+ "model.layers.11.attention.query_key_value.scales": "model-00002-of-00003.safetensors",
99
+ "model.layers.11.attention.query_key_value.weight": "model-00002-of-00003.safetensors",
100
+ "model.layers.11.attention.query_layernorm.weight": "model-00002-of-00003.safetensors",
101
+ "model.layers.11.input_layernorm.weight": "model-00002-of-00003.safetensors",
102
+ "model.layers.11.mlp.gate.expert_bias": "model-00002-of-00003.safetensors",
103
+ "model.layers.11.mlp.gate.gate_proj.biases": "model-00002-of-00003.safetensors",
104
+ "model.layers.11.mlp.gate.gate_proj.scales": "model-00002-of-00003.safetensors",
105
+ "model.layers.11.mlp.gate.gate_proj.weight": "model-00002-of-00003.safetensors",
106
+ "model.layers.11.mlp.shared_experts.down_proj.biases": "model-00002-of-00003.safetensors",
107
+ "model.layers.11.mlp.shared_experts.down_proj.scales": "model-00002-of-00003.safetensors",
108
+ "model.layers.11.mlp.shared_experts.down_proj.weight": "model-00002-of-00003.safetensors",
109
+ "model.layers.11.mlp.shared_experts.gate_proj.biases": "model-00002-of-00003.safetensors",
110
+ "model.layers.11.mlp.shared_experts.gate_proj.scales": "model-00002-of-00003.safetensors",
111
+ "model.layers.11.mlp.shared_experts.gate_proj.weight": "model-00002-of-00003.safetensors",
112
+ "model.layers.11.mlp.shared_experts.up_proj.biases": "model-00002-of-00003.safetensors",
113
+ "model.layers.11.mlp.shared_experts.up_proj.scales": "model-00002-of-00003.safetensors",
114
+ "model.layers.11.mlp.shared_experts.up_proj.weight": "model-00002-of-00003.safetensors",
115
+ "model.layers.11.mlp.switch_mlp.down_proj.biases": "model-00002-of-00003.safetensors",
116
+ "model.layers.11.mlp.switch_mlp.down_proj.scales": "model-00002-of-00003.safetensors",
117
+ "model.layers.11.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
118
+ "model.layers.11.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
119
+ "model.layers.11.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
120
+ "model.layers.11.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
121
+ "model.layers.11.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
122
+ "model.layers.11.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
123
+ "model.layers.11.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
124
+ "model.layers.11.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
125
+ "model.layers.12.attention.dense.biases": "model-00002-of-00003.safetensors",
126
+ "model.layers.12.attention.dense.scales": "model-00002-of-00003.safetensors",
127
+ "model.layers.12.attention.dense.weight": "model-00002-of-00003.safetensors",
128
+ "model.layers.12.attention.key_layernorm.weight": "model-00002-of-00003.safetensors",
129
+ "model.layers.12.attention.query_key_value.biases": "model-00002-of-00003.safetensors",
130
+ "model.layers.12.attention.query_key_value.scales": "model-00002-of-00003.safetensors",
131
+ "model.layers.12.attention.query_key_value.weight": "model-00002-of-00003.safetensors",
132
+ "model.layers.12.attention.query_layernorm.weight": "model-00002-of-00003.safetensors",
133
+ "model.layers.12.input_layernorm.weight": "model-00002-of-00003.safetensors",
134
+ "model.layers.12.mlp.gate.expert_bias": "model-00002-of-00003.safetensors",
135
+ "model.layers.12.mlp.gate.gate_proj.biases": "model-00002-of-00003.safetensors",
136
+ "model.layers.12.mlp.gate.gate_proj.scales": "model-00002-of-00003.safetensors",
137
+ "model.layers.12.mlp.gate.gate_proj.weight": "model-00002-of-00003.safetensors",
138
+ "model.layers.12.mlp.shared_experts.down_proj.biases": "model-00002-of-00003.safetensors",
139
+ "model.layers.12.mlp.shared_experts.down_proj.scales": "model-00002-of-00003.safetensors",
140
+ "model.layers.12.mlp.shared_experts.down_proj.weight": "model-00002-of-00003.safetensors",
141
+ "model.layers.12.mlp.shared_experts.gate_proj.biases": "model-00002-of-00003.safetensors",
142
+ "model.layers.12.mlp.shared_experts.gate_proj.scales": "model-00002-of-00003.safetensors",
143
+ "model.layers.12.mlp.shared_experts.gate_proj.weight": "model-00002-of-00003.safetensors",
144
+ "model.layers.12.mlp.shared_experts.up_proj.biases": "model-00002-of-00003.safetensors",
145
+ "model.layers.12.mlp.shared_experts.up_proj.scales": "model-00002-of-00003.safetensors",
146
+ "model.layers.12.mlp.shared_experts.up_proj.weight": "model-00002-of-00003.safetensors",
147
+ "model.layers.12.mlp.switch_mlp.down_proj.biases": "model-00002-of-00003.safetensors",
148
+ "model.layers.12.mlp.switch_mlp.down_proj.scales": "model-00002-of-00003.safetensors",
149
+ "model.layers.12.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
150
+ "model.layers.12.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
151
+ "model.layers.12.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
152
+ "model.layers.12.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
153
+ "model.layers.12.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
154
+ "model.layers.12.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
155
+ "model.layers.12.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
156
+ "model.layers.12.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
157
+ "model.layers.13.attention.dense.biases": "model-00002-of-00003.safetensors",
158
+ "model.layers.13.attention.dense.scales": "model-00002-of-00003.safetensors",
159
+ "model.layers.13.attention.dense.weight": "model-00002-of-00003.safetensors",
160
+ "model.layers.13.attention.key_layernorm.weight": "model-00002-of-00003.safetensors",
161
+ "model.layers.13.attention.query_key_value.biases": "model-00002-of-00003.safetensors",
162
+ "model.layers.13.attention.query_key_value.scales": "model-00002-of-00003.safetensors",
163
+ "model.layers.13.attention.query_key_value.weight": "model-00002-of-00003.safetensors",
164
+ "model.layers.13.attention.query_layernorm.weight": "model-00002-of-00003.safetensors",
165
+ "model.layers.13.input_layernorm.weight": "model-00002-of-00003.safetensors",
166
+ "model.layers.13.mlp.gate.expert_bias": "model-00002-of-00003.safetensors",
167
+ "model.layers.13.mlp.gate.gate_proj.biases": "model-00002-of-00003.safetensors",
168
+ "model.layers.13.mlp.gate.gate_proj.scales": "model-00002-of-00003.safetensors",
169
+ "model.layers.13.mlp.gate.gate_proj.weight": "model-00002-of-00003.safetensors",
170
+ "model.layers.13.mlp.shared_experts.down_proj.biases": "model-00002-of-00003.safetensors",
171
+ "model.layers.13.mlp.shared_experts.down_proj.scales": "model-00002-of-00003.safetensors",
172
+ "model.layers.13.mlp.shared_experts.down_proj.weight": "model-00002-of-00003.safetensors",
173
+ "model.layers.13.mlp.shared_experts.gate_proj.biases": "model-00002-of-00003.safetensors",
174
+ "model.layers.13.mlp.shared_experts.gate_proj.scales": "model-00002-of-00003.safetensors",
175
+ "model.layers.13.mlp.shared_experts.gate_proj.weight": "model-00002-of-00003.safetensors",
176
+ "model.layers.13.mlp.shared_experts.up_proj.biases": "model-00002-of-00003.safetensors",
177
+ "model.layers.13.mlp.shared_experts.up_proj.scales": "model-00002-of-00003.safetensors",
178
+ "model.layers.13.mlp.shared_experts.up_proj.weight": "model-00002-of-00003.safetensors",
179
+ "model.layers.13.mlp.switch_mlp.down_proj.biases": "model-00002-of-00003.safetensors",
180
+ "model.layers.13.mlp.switch_mlp.down_proj.scales": "model-00002-of-00003.safetensors",
181
+ "model.layers.13.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
182
+ "model.layers.13.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
183
+ "model.layers.13.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
184
+ "model.layers.13.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
185
+ "model.layers.13.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
186
+ "model.layers.13.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
187
+ "model.layers.13.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
188
+ "model.layers.13.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
189
+ "model.layers.14.attention.dense.biases": "model-00002-of-00003.safetensors",
190
+ "model.layers.14.attention.dense.scales": "model-00002-of-00003.safetensors",
191
+ "model.layers.14.attention.dense.weight": "model-00002-of-00003.safetensors",
192
+ "model.layers.14.attention.key_layernorm.weight": "model-00002-of-00003.safetensors",
193
+ "model.layers.14.attention.query_key_value.biases": "model-00002-of-00003.safetensors",
194
+ "model.layers.14.attention.query_key_value.scales": "model-00002-of-00003.safetensors",
195
+ "model.layers.14.attention.query_key_value.weight": "model-00002-of-00003.safetensors",
196
+ "model.layers.14.attention.query_layernorm.weight": "model-00002-of-00003.safetensors",
197
+ "model.layers.14.input_layernorm.weight": "model-00002-of-00003.safetensors",
198
+ "model.layers.14.mlp.gate.expert_bias": "model-00002-of-00003.safetensors",
199
+ "model.layers.14.mlp.gate.gate_proj.biases": "model-00002-of-00003.safetensors",
200
+ "model.layers.14.mlp.gate.gate_proj.scales": "model-00002-of-00003.safetensors",
201
+ "model.layers.14.mlp.gate.gate_proj.weight": "model-00002-of-00003.safetensors",
202
+ "model.layers.14.mlp.shared_experts.down_proj.biases": "model-00002-of-00003.safetensors",
203
+ "model.layers.14.mlp.shared_experts.down_proj.scales": "model-00002-of-00003.safetensors",
204
+ "model.layers.14.mlp.shared_experts.down_proj.weight": "model-00002-of-00003.safetensors",
205
+ "model.layers.14.mlp.shared_experts.gate_proj.biases": "model-00002-of-00003.safetensors",
206
+ "model.layers.14.mlp.shared_experts.gate_proj.scales": "model-00002-of-00003.safetensors",
207
+ "model.layers.14.mlp.shared_experts.gate_proj.weight": "model-00002-of-00003.safetensors",
208
+ "model.layers.14.mlp.shared_experts.up_proj.biases": "model-00002-of-00003.safetensors",
209
+ "model.layers.14.mlp.shared_experts.up_proj.scales": "model-00002-of-00003.safetensors",
210
+ "model.layers.14.mlp.shared_experts.up_proj.weight": "model-00002-of-00003.safetensors",
211
+ "model.layers.14.mlp.switch_mlp.down_proj.biases": "model-00002-of-00003.safetensors",
212
+ "model.layers.14.mlp.switch_mlp.down_proj.scales": "model-00002-of-00003.safetensors",
213
+ "model.layers.14.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
214
+ "model.layers.14.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
215
+ "model.layers.14.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
216
+ "model.layers.14.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
217
+ "model.layers.14.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
218
+ "model.layers.14.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
219
+ "model.layers.14.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
220
+ "model.layers.14.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
221
+ "model.layers.15.attention.dense.biases": "model-00002-of-00003.safetensors",
222
+ "model.layers.15.attention.dense.scales": "model-00002-of-00003.safetensors",
223
+ "model.layers.15.attention.dense.weight": "model-00002-of-00003.safetensors",
224
+ "model.layers.15.attention.key_layernorm.weight": "model-00002-of-00003.safetensors",
225
+ "model.layers.15.attention.query_key_value.biases": "model-00002-of-00003.safetensors",
226
+ "model.layers.15.attention.query_key_value.scales": "model-00002-of-00003.safetensors",
227
+ "model.layers.15.attention.query_key_value.weight": "model-00002-of-00003.safetensors",
228
+ "model.layers.15.attention.query_layernorm.weight": "model-00002-of-00003.safetensors",
229
+ "model.layers.15.input_layernorm.weight": "model-00002-of-00003.safetensors",
230
+ "model.layers.15.mlp.gate.expert_bias": "model-00002-of-00003.safetensors",
231
+ "model.layers.15.mlp.gate.gate_proj.biases": "model-00002-of-00003.safetensors",
232
+ "model.layers.15.mlp.gate.gate_proj.scales": "model-00002-of-00003.safetensors",
233
+ "model.layers.15.mlp.gate.gate_proj.weight": "model-00002-of-00003.safetensors",
234
+ "model.layers.15.mlp.shared_experts.down_proj.biases": "model-00002-of-00003.safetensors",
235
+ "model.layers.15.mlp.shared_experts.down_proj.scales": "model-00002-of-00003.safetensors",
236
+ "model.layers.15.mlp.shared_experts.down_proj.weight": "model-00002-of-00003.safetensors",
237
+ "model.layers.15.mlp.shared_experts.gate_proj.biases": "model-00002-of-00003.safetensors",
238
+ "model.layers.15.mlp.shared_experts.gate_proj.scales": "model-00002-of-00003.safetensors",
239
+ "model.layers.15.mlp.shared_experts.gate_proj.weight": "model-00002-of-00003.safetensors",
240
+ "model.layers.15.mlp.shared_experts.up_proj.biases": "model-00002-of-00003.safetensors",
241
+ "model.layers.15.mlp.shared_experts.up_proj.scales": "model-00002-of-00003.safetensors",
242
+ "model.layers.15.mlp.shared_experts.up_proj.weight": "model-00002-of-00003.safetensors",
243
+ "model.layers.15.mlp.switch_mlp.down_proj.biases": "model-00002-of-00003.safetensors",
244
+ "model.layers.15.mlp.switch_mlp.down_proj.scales": "model-00002-of-00003.safetensors",
245
+ "model.layers.15.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
246
+ "model.layers.15.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
247
+ "model.layers.15.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
248
+ "model.layers.15.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
249
+ "model.layers.15.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
250
+ "model.layers.15.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
251
+ "model.layers.15.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
252
+ "model.layers.15.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
253
+ "model.layers.16.attention.dense.biases": "model-00002-of-00003.safetensors",
254
+ "model.layers.16.attention.dense.scales": "model-00002-of-00003.safetensors",
255
+ "model.layers.16.attention.dense.weight": "model-00002-of-00003.safetensors",
256
+ "model.layers.16.attention.key_layernorm.weight": "model-00002-of-00003.safetensors",
257
+ "model.layers.16.attention.query_key_value.biases": "model-00002-of-00003.safetensors",
258
+ "model.layers.16.attention.query_key_value.scales": "model-00002-of-00003.safetensors",
259
+ "model.layers.16.attention.query_key_value.weight": "model-00002-of-00003.safetensors",
260
+ "model.layers.16.attention.query_layernorm.weight": "model-00002-of-00003.safetensors",
261
+ "model.layers.16.input_layernorm.weight": "model-00003-of-00003.safetensors",
262
+ "model.layers.16.mlp.gate.expert_bias": "model-00003-of-00003.safetensors",
263
+ "model.layers.16.mlp.gate.gate_proj.biases": "model-00003-of-00003.safetensors",
264
+ "model.layers.16.mlp.gate.gate_proj.scales": "model-00003-of-00003.safetensors",
265
+ "model.layers.16.mlp.gate.gate_proj.weight": "model-00003-of-00003.safetensors",
266
+ "model.layers.16.mlp.shared_experts.down_proj.biases": "model-00003-of-00003.safetensors",
267
+ "model.layers.16.mlp.shared_experts.down_proj.scales": "model-00003-of-00003.safetensors",
268
+ "model.layers.16.mlp.shared_experts.down_proj.weight": "model-00003-of-00003.safetensors",
269
+ "model.layers.16.mlp.shared_experts.gate_proj.biases": "model-00003-of-00003.safetensors",
270
+ "model.layers.16.mlp.shared_experts.gate_proj.scales": "model-00003-of-00003.safetensors",
271
+ "model.layers.16.mlp.shared_experts.gate_proj.weight": "model-00003-of-00003.safetensors",
272
+ "model.layers.16.mlp.shared_experts.up_proj.biases": "model-00003-of-00003.safetensors",
273
+ "model.layers.16.mlp.shared_experts.up_proj.scales": "model-00003-of-00003.safetensors",
274
+ "model.layers.16.mlp.shared_experts.up_proj.weight": "model-00003-of-00003.safetensors",
275
+ "model.layers.16.mlp.switch_mlp.down_proj.biases": "model-00003-of-00003.safetensors",
276
+ "model.layers.16.mlp.switch_mlp.down_proj.scales": "model-00003-of-00003.safetensors",
277
+ "model.layers.16.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
278
+ "model.layers.16.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
279
+ "model.layers.16.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
280
+ "model.layers.16.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
281
+ "model.layers.16.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
282
+ "model.layers.16.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
283
+ "model.layers.16.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
284
+ "model.layers.16.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
285
+ "model.layers.17.attention.dense.biases": "model-00003-of-00003.safetensors",
286
+ "model.layers.17.attention.dense.scales": "model-00003-of-00003.safetensors",
287
+ "model.layers.17.attention.dense.weight": "model-00003-of-00003.safetensors",
288
+ "model.layers.17.attention.key_layernorm.weight": "model-00003-of-00003.safetensors",
289
+ "model.layers.17.attention.query_key_value.biases": "model-00003-of-00003.safetensors",
290
+ "model.layers.17.attention.query_key_value.scales": "model-00003-of-00003.safetensors",
291
+ "model.layers.17.attention.query_key_value.weight": "model-00003-of-00003.safetensors",
292
+ "model.layers.17.attention.query_layernorm.weight": "model-00003-of-00003.safetensors",
293
+ "model.layers.17.input_layernorm.weight": "model-00003-of-00003.safetensors",
294
+ "model.layers.17.mlp.gate.expert_bias": "model-00003-of-00003.safetensors",
295
+ "model.layers.17.mlp.gate.gate_proj.biases": "model-00003-of-00003.safetensors",
296
+ "model.layers.17.mlp.gate.gate_proj.scales": "model-00003-of-00003.safetensors",
297
+ "model.layers.17.mlp.gate.gate_proj.weight": "model-00003-of-00003.safetensors",
298
+ "model.layers.17.mlp.shared_experts.down_proj.biases": "model-00003-of-00003.safetensors",
299
+ "model.layers.17.mlp.shared_experts.down_proj.scales": "model-00003-of-00003.safetensors",
300
+ "model.layers.17.mlp.shared_experts.down_proj.weight": "model-00003-of-00003.safetensors",
301
+ "model.layers.17.mlp.shared_experts.gate_proj.biases": "model-00003-of-00003.safetensors",
302
+ "model.layers.17.mlp.shared_experts.gate_proj.scales": "model-00003-of-00003.safetensors",
303
+ "model.layers.17.mlp.shared_experts.gate_proj.weight": "model-00003-of-00003.safetensors",
304
+ "model.layers.17.mlp.shared_experts.up_proj.biases": "model-00003-of-00003.safetensors",
305
+ "model.layers.17.mlp.shared_experts.up_proj.scales": "model-00003-of-00003.safetensors",
306
+ "model.layers.17.mlp.shared_experts.up_proj.weight": "model-00003-of-00003.safetensors",
307
+ "model.layers.17.mlp.switch_mlp.down_proj.biases": "model-00003-of-00003.safetensors",
308
+ "model.layers.17.mlp.switch_mlp.down_proj.scales": "model-00003-of-00003.safetensors",
309
+ "model.layers.17.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
310
+ "model.layers.17.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
311
+ "model.layers.17.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
312
+ "model.layers.17.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
313
+ "model.layers.17.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
314
+ "model.layers.17.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
315
+ "model.layers.17.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
316
+ "model.layers.17.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
317
+ "model.layers.18.attention.dense.biases": "model-00003-of-00003.safetensors",
318
+ "model.layers.18.attention.dense.scales": "model-00003-of-00003.safetensors",
319
+ "model.layers.18.attention.dense.weight": "model-00003-of-00003.safetensors",
320
+ "model.layers.18.attention.key_layernorm.weight": "model-00003-of-00003.safetensors",
321
+ "model.layers.18.attention.query_key_value.biases": "model-00003-of-00003.safetensors",
322
+ "model.layers.18.attention.query_key_value.scales": "model-00003-of-00003.safetensors",
323
+ "model.layers.18.attention.query_key_value.weight": "model-00003-of-00003.safetensors",
324
+ "model.layers.18.attention.query_layernorm.weight": "model-00003-of-00003.safetensors",
325
+ "model.layers.18.input_layernorm.weight": "model-00003-of-00003.safetensors",
326
+ "model.layers.18.mlp.gate.expert_bias": "model-00003-of-00003.safetensors",
327
+ "model.layers.18.mlp.gate.gate_proj.biases": "model-00003-of-00003.safetensors",
328
+ "model.layers.18.mlp.gate.gate_proj.scales": "model-00003-of-00003.safetensors",
329
+ "model.layers.18.mlp.gate.gate_proj.weight": "model-00003-of-00003.safetensors",
330
+ "model.layers.18.mlp.shared_experts.down_proj.biases": "model-00003-of-00003.safetensors",
331
+ "model.layers.18.mlp.shared_experts.down_proj.scales": "model-00003-of-00003.safetensors",
332
+ "model.layers.18.mlp.shared_experts.down_proj.weight": "model-00003-of-00003.safetensors",
333
+ "model.layers.18.mlp.shared_experts.gate_proj.biases": "model-00003-of-00003.safetensors",
334
+ "model.layers.18.mlp.shared_experts.gate_proj.scales": "model-00003-of-00003.safetensors",
335
+ "model.layers.18.mlp.shared_experts.gate_proj.weight": "model-00003-of-00003.safetensors",
336
+ "model.layers.18.mlp.shared_experts.up_proj.biases": "model-00003-of-00003.safetensors",
337
+ "model.layers.18.mlp.shared_experts.up_proj.scales": "model-00003-of-00003.safetensors",
338
+ "model.layers.18.mlp.shared_experts.up_proj.weight": "model-00003-of-00003.safetensors",
339
+ "model.layers.18.mlp.switch_mlp.down_proj.biases": "model-00003-of-00003.safetensors",
340
+ "model.layers.18.mlp.switch_mlp.down_proj.scales": "model-00003-of-00003.safetensors",
341
+ "model.layers.18.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
342
+ "model.layers.18.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
343
+ "model.layers.18.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
344
+ "model.layers.18.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
345
+ "model.layers.18.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
346
+ "model.layers.18.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
347
+ "model.layers.18.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
348
+ "model.layers.18.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
349
+ "model.layers.19.attention.dense.biases": "model-00003-of-00003.safetensors",
350
+ "model.layers.19.attention.dense.scales": "model-00003-of-00003.safetensors",
351
+ "model.layers.19.attention.dense.weight": "model-00003-of-00003.safetensors",
352
+ "model.layers.19.attention.key_layernorm.weight": "model-00003-of-00003.safetensors",
353
+ "model.layers.19.attention.query_key_value.biases": "model-00003-of-00003.safetensors",
354
+ "model.layers.19.attention.query_key_value.scales": "model-00003-of-00003.safetensors",
355
+ "model.layers.19.attention.query_key_value.weight": "model-00003-of-00003.safetensors",
356
+ "model.layers.19.attention.query_layernorm.weight": "model-00003-of-00003.safetensors",
357
+ "model.layers.19.input_layernorm.weight": "model-00003-of-00003.safetensors",
358
+ "model.layers.19.mlp.gate.expert_bias": "model-00003-of-00003.safetensors",
359
+ "model.layers.19.mlp.gate.gate_proj.biases": "model-00003-of-00003.safetensors",
360
+ "model.layers.19.mlp.gate.gate_proj.scales": "model-00003-of-00003.safetensors",
361
+ "model.layers.19.mlp.gate.gate_proj.weight": "model-00003-of-00003.safetensors",
362
+ "model.layers.19.mlp.shared_experts.down_proj.biases": "model-00003-of-00003.safetensors",
363
+ "model.layers.19.mlp.shared_experts.down_proj.scales": "model-00003-of-00003.safetensors",
364
+ "model.layers.19.mlp.shared_experts.down_proj.weight": "model-00003-of-00003.safetensors",
365
+ "model.layers.19.mlp.shared_experts.gate_proj.biases": "model-00003-of-00003.safetensors",
366
+ "model.layers.19.mlp.shared_experts.gate_proj.scales": "model-00003-of-00003.safetensors",
367
+ "model.layers.19.mlp.shared_experts.gate_proj.weight": "model-00003-of-00003.safetensors",
368
+ "model.layers.19.mlp.shared_experts.up_proj.biases": "model-00003-of-00003.safetensors",
369
+ "model.layers.19.mlp.shared_experts.up_proj.scales": "model-00003-of-00003.safetensors",
370
+ "model.layers.19.mlp.shared_experts.up_proj.weight": "model-00003-of-00003.safetensors",
371
+ "model.layers.19.mlp.switch_mlp.down_proj.biases": "model-00003-of-00003.safetensors",
372
+ "model.layers.19.mlp.switch_mlp.down_proj.scales": "model-00003-of-00003.safetensors",
373
+ "model.layers.19.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
374
+ "model.layers.19.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
375
+ "model.layers.19.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
376
+ "model.layers.19.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
377
+ "model.layers.19.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
378
+ "model.layers.19.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
379
+ "model.layers.19.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
380
+ "model.layers.19.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
381
+ "model.layers.2.attention.dense.biases": "model-00001-of-00003.safetensors",
382
+ "model.layers.2.attention.dense.scales": "model-00001-of-00003.safetensors",
383
+ "model.layers.2.attention.dense.weight": "model-00001-of-00003.safetensors",
384
+ "model.layers.2.attention.key_layernorm.weight": "model-00001-of-00003.safetensors",
385
+ "model.layers.2.attention.query_key_value.biases": "model-00001-of-00003.safetensors",
386
+ "model.layers.2.attention.query_key_value.scales": "model-00001-of-00003.safetensors",
387
+ "model.layers.2.attention.query_key_value.weight": "model-00001-of-00003.safetensors",
388
+ "model.layers.2.attention.query_layernorm.weight": "model-00001-of-00003.safetensors",
389
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00003.safetensors",
390
+ "model.layers.2.mlp.gate.expert_bias": "model-00001-of-00003.safetensors",
391
+ "model.layers.2.mlp.gate.gate_proj.biases": "model-00001-of-00003.safetensors",
392
+ "model.layers.2.mlp.gate.gate_proj.scales": "model-00001-of-00003.safetensors",
393
+ "model.layers.2.mlp.gate.gate_proj.weight": "model-00001-of-00003.safetensors",
394
+ "model.layers.2.mlp.shared_experts.down_proj.biases": "model-00001-of-00003.safetensors",
395
+ "model.layers.2.mlp.shared_experts.down_proj.scales": "model-00001-of-00003.safetensors",
396
+ "model.layers.2.mlp.shared_experts.down_proj.weight": "model-00001-of-00003.safetensors",
397
+ "model.layers.2.mlp.shared_experts.gate_proj.biases": "model-00001-of-00003.safetensors",
398
+ "model.layers.2.mlp.shared_experts.gate_proj.scales": "model-00001-of-00003.safetensors",
399
+ "model.layers.2.mlp.shared_experts.gate_proj.weight": "model-00001-of-00003.safetensors",
400
+ "model.layers.2.mlp.shared_experts.up_proj.biases": "model-00001-of-00003.safetensors",
401
+ "model.layers.2.mlp.shared_experts.up_proj.scales": "model-00001-of-00003.safetensors",
402
+ "model.layers.2.mlp.shared_experts.up_proj.weight": "model-00001-of-00003.safetensors",
403
+ "model.layers.2.mlp.switch_mlp.down_proj.biases": "model-00001-of-00003.safetensors",
404
+ "model.layers.2.mlp.switch_mlp.down_proj.scales": "model-00001-of-00003.safetensors",
405
+ "model.layers.2.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
406
+ "model.layers.2.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
407
+ "model.layers.2.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
408
+ "model.layers.2.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
409
+ "model.layers.2.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
410
+ "model.layers.2.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
411
+ "model.layers.2.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
412
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
413
+ "model.layers.3.attention.dense.biases": "model-00001-of-00003.safetensors",
414
+ "model.layers.3.attention.dense.scales": "model-00001-of-00003.safetensors",
415
+ "model.layers.3.attention.dense.weight": "model-00001-of-00003.safetensors",
416
+ "model.layers.3.attention.key_layernorm.weight": "model-00001-of-00003.safetensors",
417
+ "model.layers.3.attention.query_key_value.biases": "model-00001-of-00003.safetensors",
418
+ "model.layers.3.attention.query_key_value.scales": "model-00001-of-00003.safetensors",
419
+ "model.layers.3.attention.query_key_value.weight": "model-00001-of-00003.safetensors",
420
+ "model.layers.3.attention.query_layernorm.weight": "model-00001-of-00003.safetensors",
421
+ "model.layers.3.input_layernorm.weight": "model-00001-of-00003.safetensors",
422
+ "model.layers.3.mlp.gate.expert_bias": "model-00001-of-00003.safetensors",
423
+ "model.layers.3.mlp.gate.gate_proj.biases": "model-00001-of-00003.safetensors",
424
+ "model.layers.3.mlp.gate.gate_proj.scales": "model-00001-of-00003.safetensors",
425
+ "model.layers.3.mlp.gate.gate_proj.weight": "model-00001-of-00003.safetensors",
426
+ "model.layers.3.mlp.shared_experts.down_proj.biases": "model-00001-of-00003.safetensors",
427
+ "model.layers.3.mlp.shared_experts.down_proj.scales": "model-00001-of-00003.safetensors",
428
+ "model.layers.3.mlp.shared_experts.down_proj.weight": "model-00001-of-00003.safetensors",
429
+ "model.layers.3.mlp.shared_experts.gate_proj.biases": "model-00001-of-00003.safetensors",
430
+ "model.layers.3.mlp.shared_experts.gate_proj.scales": "model-00001-of-00003.safetensors",
431
+ "model.layers.3.mlp.shared_experts.gate_proj.weight": "model-00001-of-00003.safetensors",
432
+ "model.layers.3.mlp.shared_experts.up_proj.biases": "model-00001-of-00003.safetensors",
433
+ "model.layers.3.mlp.shared_experts.up_proj.scales": "model-00001-of-00003.safetensors",
434
+ "model.layers.3.mlp.shared_experts.up_proj.weight": "model-00001-of-00003.safetensors",
435
+ "model.layers.3.mlp.switch_mlp.down_proj.biases": "model-00001-of-00003.safetensors",
436
+ "model.layers.3.mlp.switch_mlp.down_proj.scales": "model-00001-of-00003.safetensors",
437
+ "model.layers.3.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
438
+ "model.layers.3.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
439
+ "model.layers.3.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
440
+ "model.layers.3.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
441
+ "model.layers.3.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
442
+ "model.layers.3.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
443
+ "model.layers.3.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
444
+ "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
445
+ "model.layers.4.attention.dense.biases": "model-00001-of-00003.safetensors",
446
+ "model.layers.4.attention.dense.scales": "model-00001-of-00003.safetensors",
447
+ "model.layers.4.attention.dense.weight": "model-00001-of-00003.safetensors",
448
+ "model.layers.4.attention.key_layernorm.weight": "model-00001-of-00003.safetensors",
449
+ "model.layers.4.attention.query_key_value.biases": "model-00001-of-00003.safetensors",
450
+ "model.layers.4.attention.query_key_value.scales": "model-00001-of-00003.safetensors",
451
+ "model.layers.4.attention.query_key_value.weight": "model-00001-of-00003.safetensors",
452
+ "model.layers.4.attention.query_layernorm.weight": "model-00001-of-00003.safetensors",
453
+ "model.layers.4.input_layernorm.weight": "model-00001-of-00003.safetensors",
454
+ "model.layers.4.mlp.gate.expert_bias": "model-00001-of-00003.safetensors",
455
+ "model.layers.4.mlp.gate.gate_proj.biases": "model-00001-of-00003.safetensors",
456
+ "model.layers.4.mlp.gate.gate_proj.scales": "model-00001-of-00003.safetensors",
457
+ "model.layers.4.mlp.gate.gate_proj.weight": "model-00001-of-00003.safetensors",
458
+ "model.layers.4.mlp.shared_experts.down_proj.biases": "model-00001-of-00003.safetensors",
459
+ "model.layers.4.mlp.shared_experts.down_proj.scales": "model-00001-of-00003.safetensors",
460
+ "model.layers.4.mlp.shared_experts.down_proj.weight": "model-00001-of-00003.safetensors",
461
+ "model.layers.4.mlp.shared_experts.gate_proj.biases": "model-00001-of-00003.safetensors",
462
+ "model.layers.4.mlp.shared_experts.gate_proj.scales": "model-00001-of-00003.safetensors",
463
+ "model.layers.4.mlp.shared_experts.gate_proj.weight": "model-00001-of-00003.safetensors",
464
+ "model.layers.4.mlp.shared_experts.up_proj.biases": "model-00001-of-00003.safetensors",
465
+ "model.layers.4.mlp.shared_experts.up_proj.scales": "model-00001-of-00003.safetensors",
466
+ "model.layers.4.mlp.shared_experts.up_proj.weight": "model-00001-of-00003.safetensors",
467
+ "model.layers.4.mlp.switch_mlp.down_proj.biases": "model-00001-of-00003.safetensors",
468
+ "model.layers.4.mlp.switch_mlp.down_proj.scales": "model-00001-of-00003.safetensors",
469
+ "model.layers.4.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
470
+ "model.layers.4.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
471
+ "model.layers.4.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
472
+ "model.layers.4.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
473
+ "model.layers.4.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
474
+ "model.layers.4.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
475
+ "model.layers.4.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
476
+ "model.layers.4.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
477
+ "model.layers.5.attention.dense.biases": "model-00001-of-00003.safetensors",
478
+ "model.layers.5.attention.dense.scales": "model-00001-of-00003.safetensors",
479
+ "model.layers.5.attention.dense.weight": "model-00001-of-00003.safetensors",
480
+ "model.layers.5.attention.key_layernorm.weight": "model-00001-of-00003.safetensors",
481
+ "model.layers.5.attention.query_key_value.biases": "model-00001-of-00003.safetensors",
482
+ "model.layers.5.attention.query_key_value.scales": "model-00001-of-00003.safetensors",
483
+ "model.layers.5.attention.query_key_value.weight": "model-00001-of-00003.safetensors",
484
+ "model.layers.5.attention.query_layernorm.weight": "model-00001-of-00003.safetensors",
485
+ "model.layers.5.input_layernorm.weight": "model-00001-of-00003.safetensors",
486
+ "model.layers.5.mlp.gate.expert_bias": "model-00001-of-00003.safetensors",
487
+ "model.layers.5.mlp.gate.gate_proj.biases": "model-00001-of-00003.safetensors",
488
+ "model.layers.5.mlp.gate.gate_proj.scales": "model-00001-of-00003.safetensors",
489
+ "model.layers.5.mlp.gate.gate_proj.weight": "model-00001-of-00003.safetensors",
490
+ "model.layers.5.mlp.shared_experts.down_proj.biases": "model-00001-of-00003.safetensors",
491
+ "model.layers.5.mlp.shared_experts.down_proj.scales": "model-00001-of-00003.safetensors",
492
+ "model.layers.5.mlp.shared_experts.down_proj.weight": "model-00001-of-00003.safetensors",
493
+ "model.layers.5.mlp.shared_experts.gate_proj.biases": "model-00001-of-00003.safetensors",
494
+ "model.layers.5.mlp.shared_experts.gate_proj.scales": "model-00001-of-00003.safetensors",
495
+ "model.layers.5.mlp.shared_experts.gate_proj.weight": "model-00001-of-00003.safetensors",
496
+ "model.layers.5.mlp.shared_experts.up_proj.biases": "model-00001-of-00003.safetensors",
497
+ "model.layers.5.mlp.shared_experts.up_proj.scales": "model-00001-of-00003.safetensors",
498
+ "model.layers.5.mlp.shared_experts.up_proj.weight": "model-00001-of-00003.safetensors",
499
+ "model.layers.5.mlp.switch_mlp.down_proj.biases": "model-00001-of-00003.safetensors",
500
+ "model.layers.5.mlp.switch_mlp.down_proj.scales": "model-00001-of-00003.safetensors",
501
+ "model.layers.5.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
502
+ "model.layers.5.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
503
+ "model.layers.5.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
504
+ "model.layers.5.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
505
+ "model.layers.5.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
506
+ "model.layers.5.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
507
+ "model.layers.5.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
508
+ "model.layers.5.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
509
+ "model.layers.6.attention.dense.biases": "model-00001-of-00003.safetensors",
510
+ "model.layers.6.attention.dense.scales": "model-00001-of-00003.safetensors",
511
+ "model.layers.6.attention.dense.weight": "model-00001-of-00003.safetensors",
512
+ "model.layers.6.attention.key_layernorm.weight": "model-00001-of-00003.safetensors",
513
+ "model.layers.6.attention.query_key_value.biases": "model-00001-of-00003.safetensors",
514
+ "model.layers.6.attention.query_key_value.scales": "model-00001-of-00003.safetensors",
515
+ "model.layers.6.attention.query_key_value.weight": "model-00001-of-00003.safetensors",
516
+ "model.layers.6.attention.query_layernorm.weight": "model-00001-of-00003.safetensors",
517
+ "model.layers.6.input_layernorm.weight": "model-00001-of-00003.safetensors",
518
+ "model.layers.6.mlp.gate.expert_bias": "model-00001-of-00003.safetensors",
519
+ "model.layers.6.mlp.gate.gate_proj.biases": "model-00001-of-00003.safetensors",
520
+ "model.layers.6.mlp.gate.gate_proj.scales": "model-00001-of-00003.safetensors",
521
+ "model.layers.6.mlp.gate.gate_proj.weight": "model-00001-of-00003.safetensors",
522
+ "model.layers.6.mlp.shared_experts.down_proj.biases": "model-00001-of-00003.safetensors",
523
+ "model.layers.6.mlp.shared_experts.down_proj.scales": "model-00001-of-00003.safetensors",
524
+ "model.layers.6.mlp.shared_experts.down_proj.weight": "model-00001-of-00003.safetensors",
525
+ "model.layers.6.mlp.shared_experts.gate_proj.biases": "model-00001-of-00003.safetensors",
526
+ "model.layers.6.mlp.shared_experts.gate_proj.scales": "model-00001-of-00003.safetensors",
527
+ "model.layers.6.mlp.shared_experts.gate_proj.weight": "model-00001-of-00003.safetensors",
528
+ "model.layers.6.mlp.shared_experts.up_proj.biases": "model-00001-of-00003.safetensors",
529
+ "model.layers.6.mlp.shared_experts.up_proj.scales": "model-00001-of-00003.safetensors",
530
+ "model.layers.6.mlp.shared_experts.up_proj.weight": "model-00001-of-00003.safetensors",
531
+ "model.layers.6.mlp.switch_mlp.down_proj.biases": "model-00001-of-00003.safetensors",
532
+ "model.layers.6.mlp.switch_mlp.down_proj.scales": "model-00001-of-00003.safetensors",
533
+ "model.layers.6.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
534
+ "model.layers.6.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
535
+ "model.layers.6.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
536
+ "model.layers.6.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
537
+ "model.layers.6.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
538
+ "model.layers.6.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
539
+ "model.layers.6.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
540
+ "model.layers.6.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
541
+ "model.layers.7.attention.dense.biases": "model-00001-of-00003.safetensors",
542
+ "model.layers.7.attention.dense.scales": "model-00001-of-00003.safetensors",
543
+ "model.layers.7.attention.dense.weight": "model-00001-of-00003.safetensors",
544
+ "model.layers.7.attention.key_layernorm.weight": "model-00001-of-00003.safetensors",
545
+ "model.layers.7.attention.query_key_value.biases": "model-00001-of-00003.safetensors",
546
+ "model.layers.7.attention.query_key_value.scales": "model-00001-of-00003.safetensors",
547
+ "model.layers.7.attention.query_key_value.weight": "model-00001-of-00003.safetensors",
548
+ "model.layers.7.attention.query_layernorm.weight": "model-00001-of-00003.safetensors",
549
+ "model.layers.7.input_layernorm.weight": "model-00001-of-00003.safetensors",
550
+ "model.layers.7.mlp.gate.expert_bias": "model-00001-of-00003.safetensors",
551
+ "model.layers.7.mlp.gate.gate_proj.biases": "model-00001-of-00003.safetensors",
552
+ "model.layers.7.mlp.gate.gate_proj.scales": "model-00001-of-00003.safetensors",
553
+ "model.layers.7.mlp.gate.gate_proj.weight": "model-00001-of-00003.safetensors",
554
+ "model.layers.7.mlp.shared_experts.down_proj.biases": "model-00001-of-00003.safetensors",
555
+ "model.layers.7.mlp.shared_experts.down_proj.scales": "model-00001-of-00003.safetensors",
556
+ "model.layers.7.mlp.shared_experts.down_proj.weight": "model-00001-of-00003.safetensors",
557
+ "model.layers.7.mlp.shared_experts.gate_proj.biases": "model-00001-of-00003.safetensors",
558
+ "model.layers.7.mlp.shared_experts.gate_proj.scales": "model-00001-of-00003.safetensors",
559
+ "model.layers.7.mlp.shared_experts.gate_proj.weight": "model-00001-of-00003.safetensors",
560
+ "model.layers.7.mlp.shared_experts.up_proj.biases": "model-00001-of-00003.safetensors",
561
+ "model.layers.7.mlp.shared_experts.up_proj.scales": "model-00001-of-00003.safetensors",
562
+ "model.layers.7.mlp.shared_experts.up_proj.weight": "model-00001-of-00003.safetensors",
563
+ "model.layers.7.mlp.switch_mlp.down_proj.biases": "model-00001-of-00003.safetensors",
564
+ "model.layers.7.mlp.switch_mlp.down_proj.scales": "model-00001-of-00003.safetensors",
565
+ "model.layers.7.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
566
+ "model.layers.7.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
567
+ "model.layers.7.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
568
+ "model.layers.7.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
569
+ "model.layers.7.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
570
+ "model.layers.7.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
571
+ "model.layers.7.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
572
+ "model.layers.7.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
573
+ "model.layers.8.attention.dense.biases": "model-00001-of-00003.safetensors",
574
+ "model.layers.8.attention.dense.scales": "model-00001-of-00003.safetensors",
575
+ "model.layers.8.attention.dense.weight": "model-00001-of-00003.safetensors",
576
+ "model.layers.8.attention.key_layernorm.weight": "model-00001-of-00003.safetensors",
577
+ "model.layers.8.attention.query_key_value.biases": "model-00001-of-00003.safetensors",
578
+ "model.layers.8.attention.query_key_value.scales": "model-00001-of-00003.safetensors",
579
+ "model.layers.8.attention.query_key_value.weight": "model-00001-of-00003.safetensors",
580
+ "model.layers.8.attention.query_layernorm.weight": "model-00001-of-00003.safetensors",
581
+ "model.layers.8.input_layernorm.weight": "model-00002-of-00003.safetensors",
582
+ "model.layers.8.mlp.gate.expert_bias": "model-00002-of-00003.safetensors",
583
+ "model.layers.8.mlp.gate.gate_proj.biases": "model-00002-of-00003.safetensors",
584
+ "model.layers.8.mlp.gate.gate_proj.scales": "model-00002-of-00003.safetensors",
585
+ "model.layers.8.mlp.gate.gate_proj.weight": "model-00002-of-00003.safetensors",
586
+ "model.layers.8.mlp.shared_experts.down_proj.biases": "model-00002-of-00003.safetensors",
587
+ "model.layers.8.mlp.shared_experts.down_proj.scales": "model-00002-of-00003.safetensors",
588
+ "model.layers.8.mlp.shared_experts.down_proj.weight": "model-00002-of-00003.safetensors",
589
+ "model.layers.8.mlp.shared_experts.gate_proj.biases": "model-00002-of-00003.safetensors",
590
+ "model.layers.8.mlp.shared_experts.gate_proj.scales": "model-00002-of-00003.safetensors",
591
+ "model.layers.8.mlp.shared_experts.gate_proj.weight": "model-00002-of-00003.safetensors",
592
+ "model.layers.8.mlp.shared_experts.up_proj.biases": "model-00002-of-00003.safetensors",
593
+ "model.layers.8.mlp.shared_experts.up_proj.scales": "model-00002-of-00003.safetensors",
594
+ "model.layers.8.mlp.shared_experts.up_proj.weight": "model-00002-of-00003.safetensors",
595
+ "model.layers.8.mlp.switch_mlp.down_proj.biases": "model-00002-of-00003.safetensors",
596
+ "model.layers.8.mlp.switch_mlp.down_proj.scales": "model-00002-of-00003.safetensors",
597
+ "model.layers.8.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
598
+ "model.layers.8.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
599
+ "model.layers.8.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
600
+ "model.layers.8.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
601
+ "model.layers.8.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
602
+ "model.layers.8.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
603
+ "model.layers.8.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
604
+ "model.layers.8.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
605
+ "model.layers.9.attention.dense.biases": "model-00002-of-00003.safetensors",
606
+ "model.layers.9.attention.dense.scales": "model-00002-of-00003.safetensors",
607
+ "model.layers.9.attention.dense.weight": "model-00002-of-00003.safetensors",
608
+ "model.layers.9.attention.key_layernorm.weight": "model-00002-of-00003.safetensors",
609
+ "model.layers.9.attention.query_key_value.biases": "model-00002-of-00003.safetensors",
610
+ "model.layers.9.attention.query_key_value.scales": "model-00002-of-00003.safetensors",
611
+ "model.layers.9.attention.query_key_value.weight": "model-00002-of-00003.safetensors",
612
+ "model.layers.9.attention.query_layernorm.weight": "model-00002-of-00003.safetensors",
613
+ "model.layers.9.input_layernorm.weight": "model-00002-of-00003.safetensors",
614
+ "model.layers.9.mlp.gate.expert_bias": "model-00002-of-00003.safetensors",
615
+ "model.layers.9.mlp.gate.gate_proj.biases": "model-00002-of-00003.safetensors",
616
+ "model.layers.9.mlp.gate.gate_proj.scales": "model-00002-of-00003.safetensors",
617
+ "model.layers.9.mlp.gate.gate_proj.weight": "model-00002-of-00003.safetensors",
618
+ "model.layers.9.mlp.shared_experts.down_proj.biases": "model-00002-of-00003.safetensors",
619
+ "model.layers.9.mlp.shared_experts.down_proj.scales": "model-00002-of-00003.safetensors",
620
+ "model.layers.9.mlp.shared_experts.down_proj.weight": "model-00002-of-00003.safetensors",
621
+ "model.layers.9.mlp.shared_experts.gate_proj.biases": "model-00002-of-00003.safetensors",
622
+ "model.layers.9.mlp.shared_experts.gate_proj.scales": "model-00002-of-00003.safetensors",
623
+ "model.layers.9.mlp.shared_experts.gate_proj.weight": "model-00002-of-00003.safetensors",
624
+ "model.layers.9.mlp.shared_experts.up_proj.biases": "model-00002-of-00003.safetensors",
625
+ "model.layers.9.mlp.shared_experts.up_proj.scales": "model-00002-of-00003.safetensors",
626
+ "model.layers.9.mlp.shared_experts.up_proj.weight": "model-00002-of-00003.safetensors",
627
+ "model.layers.9.mlp.switch_mlp.down_proj.biases": "model-00002-of-00003.safetensors",
628
+ "model.layers.9.mlp.switch_mlp.down_proj.scales": "model-00002-of-00003.safetensors",
629
+ "model.layers.9.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
630
+ "model.layers.9.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
631
+ "model.layers.9.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
632
+ "model.layers.9.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
633
+ "model.layers.9.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
634
+ "model.layers.9.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
635
+ "model.layers.9.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
636
+ "model.layers.9.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
637
+ "model.norm.weight": "model-00003-of-00003.safetensors",
638
+ "model.word_embeddings.biases": "model-00001-of-00003.safetensors",
639
+ "model.word_embeddings.scales": "model-00001-of-00003.safetensors",
640
+ "model.word_embeddings.weight": "model-00001-of-00003.safetensors"
641
+ }
642
+ }
modeling_bailing_moe_v2.py ADDED
@@ -0,0 +1,1904 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2025 Antgroup and The HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
5
+ # and OPT implementations in this library. It has been modified from its
6
+ # original forms to accommodate minor architectural differences compared
7
+ # to GPT-NeoX and OPT used by the Meta AI team that trained the model.
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ """PyTorch BailingMoE model."""
21
+
22
+ import math
23
+ import warnings
24
+ from typing import List, Optional, Tuple, Union
25
+
26
+ import torch
27
+ import torch.nn.functional as F
28
+ from torch import nn
29
+
30
+ from transformers.activations import ACT2FN
31
+ from transformers.cache_utils import Cache, DynamicCache
32
+ from transformers.modeling_attn_mask_utils import (
33
+ AttentionMaskConverter,
34
+ _prepare_4d_attention_mask,
35
+ _prepare_4d_causal_attention_mask,
36
+ _prepare_4d_causal_attention_mask_for_sdpa,
37
+ )
38
+ from transformers.modeling_outputs import MoeModelOutputWithPast
39
+ from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
40
+ from transformers.modeling_utils import PreTrainedModel
41
+ from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS, is_torch_greater_or_equal_than_1_13
42
+ from transformers.utils import (
43
+ add_start_docstrings,
44
+ add_start_docstrings_to_model_forward,
45
+ is_flash_attn_2_available,
46
+ is_flash_attn_greater_or_equal_2_10,
47
+ logging,
48
+ replace_return_docstrings,
49
+ )
50
+ from transformers.utils.import_utils import is_torch_fx_available
51
+ from .configuration_bailing_moe_v2 import BailingMoeV2Config
52
+ from transformers.generation.utils import GenerationMixin
53
+ from dataclasses import dataclass
54
+ from transformers.utils import ModelOutput
55
+ from einops import rearrange
56
+ from functools import lru_cache
57
+
58
+ if is_flash_attn_2_available():
59
+ from flash_attn import flash_attn_func, flash_attn_varlen_func
60
+ from flash_attn.bert_padding import index_first_axis, pad_input, unpad_input # noqa
61
+
62
+
63
+ # This makes `_prepare_4d_causal_attention_mask` a leaf function in the FX graph.
64
+ # It means that the function will not be traced through and simply appear as a node in the graph.
65
+ if is_torch_fx_available():
66
+ if not is_torch_greater_or_equal_than_1_13:
67
+ import torch.fx
68
+
69
+ _prepare_4d_causal_attention_mask = torch.fx.wrap(_prepare_4d_causal_attention_mask)
70
+
71
+
72
+ logger = logging.get_logger(__name__)
73
+
74
+ _CONFIG_FOR_DOC = "BailingMoeV2Config"
75
+
76
+
77
+ def nonzero(x):
78
+ return x.nonzero(as_tuple=True)
79
+
80
+
81
+ @lru_cache(maxsize=16)
82
+ def calc_chunks(cu_seqlen, moba_chunk_size):
83
+ """calc chunks that needs moba attention"""
84
+
85
+ # batch_sizes[batch_idx] = batch size ( seqlen ) of batch idx
86
+ batch_sizes = cu_seqlen[1:] - cu_seqlen[:-1]
87
+ # batch_num_chunk[batch_idx] = how many chunk in batch idx
88
+ batch_num_chunk = (batch_sizes + (moba_chunk_size - 1)) // moba_chunk_size
89
+ # cu_num_chunk[batch_idx] = first chunk id of this batch
90
+ cu_num_chunk = torch.ones(
91
+ batch_num_chunk.numel() + 1,
92
+ device=cu_seqlen.device,
93
+ dtype=batch_num_chunk.dtype,
94
+ )
95
+ cu_num_chunk[1:] = batch_num_chunk.cumsum(dim=0)
96
+ # total chunk ( for all batch )
97
+ num_chunk = cu_num_chunk[-1]
98
+ # chunk_sizes[chunk_idx] = chunk_size of chunk idx
99
+ chunk_sizes = torch.full((num_chunk + 1,), moba_chunk_size, dtype=torch.int32, device=cu_seqlen.device)
100
+ chunk_sizes[0] = 0 # for calc cu chunk
101
+ batch_last_chunk_size = batch_sizes - (batch_num_chunk - 1) * moba_chunk_size
102
+ chunk_sizes[cu_num_chunk[1:]] = batch_last_chunk_size
103
+ # cu_chunk[chunk_idx] = the start chunk offset of chunk idx
104
+ cu_chunk = chunk_sizes.cumsum(dim=-1, dtype=torch.int32)
105
+ # chunk_to_batch[chunk_idx] = batch idx of the chunk idx
106
+ chunk_to_batch = torch.zeros((num_chunk,), dtype=torch.int32, device=cu_seqlen.device)
107
+ chunk_to_batch[cu_num_chunk[1:-1]] = 1
108
+ chunk_to_batch = chunk_to_batch.cumsum(dim=0, dtype=torch.int32)
109
+
110
+ """ filter chunks that need moba attn """
111
+
112
+ # filter chunks ( remove last chunk of each batch )
113
+ # filtered_chunk_indices: chunk index list that excludes the last chunk of each batch
114
+ chunk_to_remove = cu_num_chunk[1:] - 1
115
+ chunk_to_remain = torch.ones((num_chunk,), dtype=torch.bool, device=cu_seqlen.device)
116
+ chunk_to_remain[chunk_to_remove] = False
117
+ filtered_chunk_indices = chunk_to_remain.nonzero(as_tuple=True)[0]
118
+ num_filtered_chunk = len(filtered_chunk_indices)
119
+
120
+ return (
121
+ cu_chunk,
122
+ filtered_chunk_indices,
123
+ num_filtered_chunk,
124
+ chunk_to_batch,
125
+ )
126
+
127
+
128
+ def _prepare_for_moba(
129
+ q: torch.Tensor,
130
+ k: torch.Tensor,
131
+ v: torch.Tensor,
132
+ cu_seqlens: torch.Tensor,
133
+ max_seqlen: int,
134
+ moba_chunk_size: int,
135
+ moba_topk: int,
136
+ is_decode: bool = False
137
+ ) -> torch.Tensor:
138
+ """An efficient version of moba implementation with triton kernels and flash-attn, the core logic:
139
+ 1. Calculate the chunks and the number of chunks, n = floor(data_size / chunk_size)
140
+ - tokens in the tail chunk are reserved for self attn
141
+ - tokens in other chunks will be processed in later steps
142
+ 2. K in each chunk will calculate mean value as the representative k, and Q will attend to these representative
143
+ k to get the gate logit, which will be used to select topk chunks
144
+ 3. Select the topk chunks and get the dense q for each kv chunk pair and do the varlen attention
145
+ 4. Combine the varlen attn and self attn results via online softmax to get the final result
146
+
147
+ Args:
148
+ q (torch.Tensor): [seqlen, head, head_dim]
149
+ k (torch.Tensor): [seqlen, head, head_dim]
150
+ v (torch.Tensor): [seqlen, head, head_dim]
151
+ cu_seqlens (torch.Tensor): the cumulative sequence length tensor, same definition in flash attn
152
+ max_seqlen (int): the max sequence length of the batch, same definition in flash attn
153
+
154
+ Returns:
155
+ attn_output (torch.Tensor): [seqlen, head, head_dim]
156
+ """
157
+
158
+ kv = torch.stack((k, v), dim=1)
159
+
160
+ """ some basic variables """
161
+ # qkv shape = [ S, H, D ]
162
+ seqlen_q, num_head, head_dim = q.shape
163
+ seqlen_kv, num_head_kv, _ = k.shape
164
+ replicas = num_head // num_head_kv
165
+
166
+ """ prepare chunk meta """
167
+ (
168
+ cu_chunk,
169
+ filtered_chunk_indices,
170
+ num_filtered_chunk,
171
+ chunk_to_batch,
172
+ ) = calc_chunks(cu_seqlens, moba_chunk_size)
173
+ # cu_chunk: [num_chunks + 1], the start position of each chunk
174
+ # filtered_chunk_indices: [num_filtered_chunk], the indices of filtered chunk (filter out last in each batch)
175
+ # chunk_to_batch: [total_num_chunks], chunk_to_batch[i] stands for the batch index of i-th chunk
176
+
177
+ self_attn_cu_seqlen = cu_chunk
178
+ # filtered_kv is a dense matrix that only contains filtered chunk of kv
179
+ filtered_kv_indices = torch.arange(0, moba_chunk_size, dtype=torch.int64, device=q.device)[None, :].repeat(
180
+ num_filtered_chunk, 1
181
+ )
182
+ filtered_kv_indices += cu_chunk[filtered_chunk_indices][:, None]
183
+ index_expanded = filtered_kv_indices.view(-1).view(-1, 1, 1, 1).expand(-1, 2, kv.shape[-2], kv.shape[-1])
184
+ filtered_kv = torch.gather(kv, 0, index_expanded)
185
+
186
+ """ calc key_gate_weight and gate """
187
+
188
+ # key_gate_weight [ F_N_CHUNK, HEAD, HEAD_DIM ]
189
+ key_gate_weight = (
190
+ filtered_kv[:, 0].view(num_filtered_chunk, moba_chunk_size, num_head_kv, head_dim).mean(dim=1)
191
+ )
192
+
193
+ # we will adjust selective topk to moba_topk - 1, as the last chunk is always chosen
194
+ moba_topk = min(moba_topk - 1, num_filtered_chunk)
195
+ need_moba_attn = moba_topk > 0
196
+ # corner case: if no moba attn needed, just return self attn
197
+ if not need_moba_attn:
198
+ return None, None, None, None, None, None, None
199
+
200
+ query_gate_weight = q.view(seqlen_q, num_head_kv, replicas, head_dim).mean(dim=2).float()
201
+ key_gate_weight = key_gate_weight.type(torch.float32) # float logit for better gate logit perception
202
+ gate = torch.einsum("nhd,shd->nhs", key_gate_weight, query_gate_weight) # gate [ F_N_CHUNK, HEAD, SEQ ]
203
+ key_gate_weight = key_gate_weight.type_as(k)
204
+ q = q.type_as(k)
205
+
206
+ # pose process gate, masking unchosen batch and apply causal mask to current chunk
207
+ gate_seq_idx = torch.arange(0, seqlen_q, device=q.device, dtype=torch.int32)[None, :].repeat(num_filtered_chunk, 1)
208
+ chunk_end = cu_chunk[filtered_chunk_indices + 1]
209
+ batch_end = cu_seqlens[chunk_to_batch[filtered_chunk_indices] + 1]
210
+ gate_chunk_end_mask = gate_seq_idx < chunk_end[:, None]
211
+ gate_batch_end_mask = gate_seq_idx >= batch_end[:, None]
212
+ gate_inf_mask = gate_chunk_end_mask | gate_batch_end_mask
213
+ gate.masked_fill_(gate_inf_mask.unsqueeze(1), -float("inf"))
214
+
215
+ """ find moba q that needs moba attn """
216
+ # find topk chunks
217
+ # gate_mask [ N_CHUNK, HEAD, SEQ ], true indicates that needs attention
218
+ _, gate_top_k_idx = torch.topk(gate, k=moba_topk, dim=0, largest=True, sorted=False)
219
+ # apply causal mask
220
+ gate_mask = torch.logical_not(gate.isinf())
221
+ # select topk chunks
222
+ gate_idx_mask = torch.zeros(gate_mask.shape, dtype=torch.bool, device=q.device)
223
+ gate_idx_mask = gate_idx_mask.scatter_(dim=0, index=gate_top_k_idx, value=True)
224
+ gate_mask = torch.logical_and(gate_mask, gate_idx_mask)
225
+
226
+ moba_q_indices = nonzero(gate_mask.reshape(gate_mask.shape[0], -1))[-1] # .nonzero(as_tuple=True)[
227
+ # -1
228
+ # ] # [ HS indices ] * N
229
+ # moba_seqlen_q indicates that how many q chunks are selected for each kv chunk - head
230
+ moba_seqlen_q = gate_mask.sum(dim=-1).flatten()
231
+ # select all q that needs moba attn based on the moba_q_indices
232
+
233
+ # GQA
234
+ # moba_q_pre = q.transpose(0, 1).reshape(-1, q.size(-1))
235
+ moba_q = q.view(seqlen_q, num_head_kv, replicas, head_dim)
236
+ moba_q_pre = moba_q.transpose(0, 1).reshape(-1, *moba_q.shape[2:])
237
+
238
+ # GQA
239
+ index_expanded = moba_q_indices.view(-1, 1, 1).expand(-1, replicas, moba_q_pre.size(-1))
240
+
241
+ moba_q = torch.gather(moba_q_pre, 0, index_expanded)
242
+
243
+ # moba_q_sh_indices represents the position in the origin q tensor of each q token inside moba_q
244
+ # GQA
245
+ moba_q_sh_indices = moba_q_indices % seqlen_q * num_head_kv + moba_q_indices // seqlen_q
246
+
247
+ """ prepare moba kv """
248
+ # Since moba_q is organized as HS * N, we need to reorganize kv to adapt to q
249
+
250
+ # cut off zero experts
251
+ q_zero_mask = moba_seqlen_q == 0
252
+ valid_expert_mask = ~q_zero_mask
253
+ zero_expert_count = q_zero_mask.sum()
254
+ # only keep the kv that has q select > 0
255
+ if zero_expert_count > 0:
256
+ moba_seqlen_q = moba_seqlen_q[valid_expert_mask]
257
+ # moba cu_seqlen for flash attn
258
+ moba_cu_seqlen_q = torch.cat(
259
+ (
260
+ torch.tensor([0], device=q.device, dtype=moba_seqlen_q.dtype),
261
+ moba_seqlen_q.cumsum(dim=0),
262
+ ),
263
+ dim=0,
264
+ ).to(torch.int32)
265
+ moba_kv = filtered_kv.permute(2, 0, 1, 3)
266
+ moba_kv = moba_kv.split(moba_chunk_size, dim=1)
267
+ moba_kv = torch.cat(moba_kv, dim=0)
268
+
269
+ if zero_expert_count > 0:
270
+ assert valid_expert_mask.sum() == moba_kv.shape[0] - zero_expert_count
271
+ moba_kv = moba_kv[valid_expert_mask] # cut off zero Q expert from kv , or the grad may be nan
272
+ moba_kv = moba_kv.flatten(start_dim=0, end_dim=1).unsqueeze(2)
273
+ moba_cu_seqlen_kv = (
274
+ torch.arange(
275
+ 0,
276
+ num_filtered_chunk * num_head_kv + 1 - zero_expert_count,
277
+ dtype=torch.int32,
278
+ device=q.device,
279
+ )
280
+ * moba_chunk_size
281
+ )
282
+
283
+ return self_attn_cu_seqlen, moba_q, moba_kv, moba_cu_seqlen_q, moba_cu_seqlen_kv, moba_chunk_size, moba_q_sh_indices
284
+
285
+
286
+ def _moba_attn_varlen_prefill(
287
+ q: torch.Tensor,
288
+ k: torch.Tensor,
289
+ v: torch.Tensor,
290
+ cu_seqlens: torch.Tensor,
291
+ max_seqlen: int,
292
+ moba_chunk_size: int,
293
+ moba_topk: int,
294
+ ) -> torch.Tensor:
295
+ """An efficient version of moba implementation with triton kernels and flash-attn, the core logic:
296
+ 1. Calculate the chunks and the number of chunks, n = floor(data_size / chunk_size)
297
+ - tokens in the tail chunk are reserved for self attn
298
+ - tokens in other chunks will be processed in later steps
299
+ 2. K in each chunk will calculate mean value as the representative k, and Q will attend to these representative
300
+ k to get the gate logit, which will be used to select topk chunks
301
+ 3. Select the topk chunks and get the dense q for each kv chunk pair and do the varlen attention
302
+ 4. Combine the varlen attn and self attn results via online softmax to get the final result
303
+
304
+ Args:
305
+ q (torch.Tensor): [seqlen, head, head_dim]
306
+ k (torch.Tensor): [seqlen, head, head_dim]
307
+ v (torch.Tensor): [seqlen, head, head_dim]
308
+ cu_seqlens (torch.Tensor): the cumulative sequence length tensor, same definition in flash attn
309
+ max_seqlen (int): the max sequence length of the batch, same definition in flash attn
310
+
311
+ Returns:
312
+ attn_output (torch.Tensor): [seqlen, head, head_dim]
313
+ """
314
+
315
+ self_attn_cu_seqlen, moba_q, moba_kv, moba_cu_seqlen_q, moba_cu_seqlen_kv, moba_chunk_size, moba_q_sh_indices = (
316
+ _prepare_for_moba(q, k, v, cu_seqlens, max_seqlen, moba_chunk_size, moba_topk)
317
+ )
318
+
319
+ if moba_q is None:
320
+ return flash_attn_varlen_func(q, k, v, cu_seqlens, cu_seqlens, max_seqlen, max_seqlen, causal=True)
321
+ softmax_scale = q.shape[-1] ** (-0.5)
322
+
323
+ # self attn
324
+ self_attn_out_sh, self_attn_lse_hs, *rest = flash_attn_varlen_func(
325
+ q=q,
326
+ k=k,
327
+ v=v,
328
+ cu_seqlens_q=self_attn_cu_seqlen,
329
+ cu_seqlens_k=self_attn_cu_seqlen,
330
+ max_seqlen_q=max_seqlen,
331
+ max_seqlen_k=max_seqlen,
332
+ softmax_scale=softmax_scale,
333
+ causal=True,
334
+ return_attn_probs=True
335
+ )
336
+
337
+ # moba attn
338
+ moba_attn_out, moba_attn_lse_hs, *rest = flash_attn_varlen_func(
339
+ q=moba_q,
340
+ k=moba_kv[:, 0],
341
+ v=moba_kv[:, 1],
342
+ cu_seqlens_q=moba_cu_seqlen_q,
343
+ cu_seqlens_k=moba_cu_seqlen_kv,
344
+ max_seqlen_q=max_seqlen,
345
+ max_seqlen_k=moba_chunk_size,
346
+ softmax_scale=softmax_scale,
347
+ causal=False,
348
+ return_attn_probs=True
349
+ )
350
+
351
+ kv_replicas = q.shape[1] // k.shape[1]
352
+ h, s = self_attn_lse_hs.shape
353
+
354
+ # convert lse shape hs -> sh ( follow the legacy mix attn logic )
355
+ self_attn_lse_sh = self_attn_lse_hs.t().view(s, k.shape[1], kv_replicas).contiguous()
356
+ moba_attn_lse = moba_attn_lse_hs.t().contiguous()
357
+
358
+ max_lse_1d = self_attn_lse_sh.view(-1, kv_replicas)
359
+ max_lse_1d = max_lse_1d.index_reduce(0, moba_q_sh_indices, moba_attn_lse, "amax")
360
+ self_attn_lse_sh = self_attn_lse_sh - max_lse_1d.view_as(self_attn_lse_sh)
361
+
362
+ moba_attn_lse = (
363
+ moba_attn_lse.view(-1, kv_replicas).sub(max_lse_1d.index_select(0, moba_q_sh_indices)).reshape_as(moba_attn_lse)
364
+ )
365
+
366
+ mixed_attn_se_sh = self_attn_lse_sh.exp()
367
+ moba_attn_se = moba_attn_lse.exp()
368
+
369
+ mixed_view = mixed_attn_se_sh.view(-1, kv_replicas)
370
+ result_view = mixed_view.index_add(0, moba_q_sh_indices, moba_attn_se.view(-1, kv_replicas))
371
+
372
+ mixed_attn_se_sh = result_view.view_as(mixed_attn_se_sh)
373
+ mixed_attn_lse_sh = mixed_attn_se_sh.log()
374
+
375
+ # add attn output
376
+ factor = (self_attn_lse_sh - mixed_attn_lse_sh).exp() # [ vS, H ]
377
+ self_attn_out_sh = self_attn_out_sh * factor.view(self_attn_out_sh.shape[0], self_attn_out_sh.shape[1], 1)
378
+ output_2d = self_attn_out_sh.reshape(q.shape[0] * k.shape[1], kv_replicas, q.shape[2])
379
+
380
+ # add moba output
381
+ mixed_attn_lse = mixed_attn_lse_sh.view(-1, kv_replicas).index_select(0, moba_q_sh_indices).view_as(moba_attn_lse)
382
+ factor = (moba_attn_lse - mixed_attn_lse).exp() # [ vS, H ]
383
+ moba_attn_out = moba_attn_out * factor.unsqueeze(-1)
384
+ raw_attn_out = moba_attn_out.view(-1, kv_replicas, moba_attn_out.shape[-1])
385
+ output_2d.index_add_(0, moba_q_sh_indices, raw_attn_out)
386
+
387
+ # add back max lse
388
+ mixed_attn_lse_sh = mixed_attn_lse_sh + max_lse_1d.view_as(mixed_attn_se_sh)
389
+
390
+ return output_2d.view(q.shape[0], q.shape[1], q.shape[2]).to(q.dtype)
391
+
392
+
393
+ def roll_tensor(tensor, shifts=-1, dims=-1, fill_value=0):
394
+ """Roll the tensor input along the given dimension(s).
395
+ Inserted elements are set to be 0.0.
396
+ """
397
+ rolled_tensor = torch.roll(tensor, shifts=shifts, dims=dims)
398
+ rolled_tensor.select(dims, shifts).fill_(fill_value)
399
+ return rolled_tensor, rolled_tensor.sum()
400
+
401
+
402
+ @dataclass
403
+ class MoEV2CausalLMOutputWithPast(ModelOutput):
404
+ """
405
+ Base class for causal language model (or autoregressive) outputs as well as Mixture of Expert's router hidden
406
+ states terms, to train a MoE model.
407
+ Args:
408
+ loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
409
+ Language modeling loss (for next-token prediction).
410
+ logits (`torch.FloatTensor` of shape `(batch_size, sequence_length, config.vocab_size)`):
411
+ Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
412
+ past_key_values (`Cache`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
413
+ It is a [`~cache_utils.Cache`] instance. For more details, see our [kv cache guide](https://huggingface.co/docs/transformers/en/kv_cache).
414
+ Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
415
+ `past_key_values` input) to speed up sequential decoding.
416
+ hidden_states (`tuple(torch.FloatTensor)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
417
+ Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, +
418
+ one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`.
419
+ Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.
420
+ attentions (`tuple(torch.FloatTensor)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
421
+ Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
422
+ sequence_length)`.
423
+ Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
424
+ heads.
425
+ z_loss (`torch.FloatTensor`, *optional*, returned when `labels` is provided):
426
+ z_loss for the sparse modules.
427
+ aux_loss (`torch.FloatTensor`, *optional*, returned when `labels` is provided):
428
+ aux_loss for the sparse modules.
429
+ router_logits (`tuple(torch.FloatTensor)`, *optional*, returned when `output_router_logits=True` is passed or when `config.add_router_probs=True`):
430
+ Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, sequence_length, num_experts)`.
431
+ Router logits of the encoder model, useful to compute the auxiliary loss and the z_loss for the sparse
432
+ modules.
433
+ """
434
+
435
+ loss: Optional[torch.FloatTensor] = None
436
+ logits: Optional[torch.FloatTensor] = None
437
+ past_key_values: Optional[Cache] = None
438
+ hidden_states: Optional[tuple[torch.FloatTensor, ...]] = None
439
+ attentions: Optional[tuple[torch.FloatTensor, ...]] = None
440
+ z_loss: Optional[torch.FloatTensor] = None
441
+ aux_loss: Optional[torch.FloatTensor] = None
442
+ router_logits: Optional[tuple[torch.FloatTensor]] = None
443
+ mtp_loss: Optional[torch.FloatTensor] = None
444
+ mtp_logits: Optional[tuple[torch.FloatTensor, ...]] = None
445
+
446
+
447
+ class MoeV2ModelOutputWithPast(MoeModelOutputWithPast):
448
+
449
+ def __init__(self, mtp_hidden_states=None, **kwargs):
450
+ super().__init__(**kwargs)
451
+ self.mtp_hidden_states = mtp_hidden_states
452
+
453
+
454
+ def _get_unpad_data(attention_mask):
455
+ seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32)
456
+ indices = torch.nonzero(attention_mask.flatten(), as_tuple=False).flatten()
457
+ max_seqlen_in_batch = seqlens_in_batch.max().item()
458
+ cu_seqlens = F.pad(torch.cumsum(seqlens_in_batch, dim=0, dtype=torch.torch.int32), (1, 0))
459
+ return (
460
+ indices,
461
+ cu_seqlens,
462
+ max_seqlen_in_batch,
463
+ )
464
+
465
+
466
+ def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None):
467
+ warnings.warn(
468
+ "Calling `transformers.models.BailingMoeV2.modeling_BailingMoeV2._prepare_4d_attention_mask` is deprecated and will be removed in v4.37. Use `transformers.modeling_attn_mask_utils._prepare_4d_attention_mask"
469
+ )
470
+ return _prepare_4d_attention_mask(mask=mask, dtype=dtype, tgt_len=tgt_len)
471
+
472
+
473
+ def _make_causal_mask(
474
+ input_ids_shape: torch.Size, dtype: torch.dtype, device: torch.device, past_key_values_length: int = 0
475
+ ):
476
+ warnings.warn(
477
+ "Calling `transformers.models.BailingMoeV2.modeling_BailingMoeV2._make_causal_mask` is deprecated and will be removed in v4.37. Use `transformers.models.BailingMoeV2.modeling_BailingMoeV2.AttentionMaskConverter._make_causal_mask"
478
+ )
479
+ return AttentionMaskConverter._make_causal_mask(
480
+ input_ids_shape=input_ids_shape, dtype=dtype, device=device, past_key_values_length=past_key_values_length
481
+ )
482
+
483
+
484
+ class BailingMoeV2RMSNorm(nn.Module):
485
+ def __init__(self, hidden_size, eps=1e-6):
486
+ """
487
+ BailingMoeV2RMSNorm is equivalent to T5LayerNorm
488
+ """
489
+ super().__init__()
490
+ self.weight = nn.Parameter(torch.ones(hidden_size))
491
+ self.variance_epsilon = eps
492
+
493
+ def forward(self, hidden_states):
494
+ input_dtype = hidden_states.dtype
495
+ hidden_states = hidden_states.to(torch.float32)
496
+ variance = hidden_states.pow(2).mean(-1, keepdim=True)
497
+ hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
498
+ return self.weight * hidden_states.to(input_dtype)
499
+
500
+
501
+ ALL_LAYERNORM_LAYERS.append(BailingMoeV2RMSNorm)
502
+
503
+
504
+ class BailingMoeV2RotaryEmbedding(nn.Module):
505
+ def __init__(self, config: BailingMoeV2Config, device=None):
506
+ super().__init__()
507
+ # BC: "rope_type" was originally "type"
508
+ if hasattr(config, "rope_scaling") and config.rope_scaling is not None:
509
+ self.rope_type = config.rope_scaling.get("rope_type", config.rope_scaling.get("type"))
510
+ else:
511
+ self.rope_type = "default"
512
+ self.max_seq_len_cached = config.max_position_embeddings
513
+ self.original_max_seq_len = config.max_position_embeddings
514
+
515
+ self.config = config
516
+ self.rope_init_fn = ROPE_INIT_FUNCTIONS[self.rope_type]
517
+
518
+ inv_freq, self.attention_scaling = self.rope_init_fn(self.config, device)
519
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
520
+ self.original_inv_freq = self.inv_freq
521
+
522
+ @torch.no_grad()
523
+ @dynamic_rope_update # power user: used with advanced RoPE types (e.g. dynamic rope)
524
+ def forward(self, x, position_ids):
525
+ inv_freq_expanded = self.inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1).to(x.device)
526
+ position_ids_expanded = position_ids[:, None, :].float()
527
+
528
+ device_type = x.device.type if isinstance(x.device.type, str) and x.device.type != "mps" else "cpu"
529
+ with torch.autocast(device_type=device_type, enabled=False): # Force float32
530
+ freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
531
+ emb = torch.cat((freqs, freqs), dim=-1)
532
+ cos = emb.cos() * self.attention_scaling
533
+ sin = emb.sin() * self.attention_scaling
534
+
535
+ return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
536
+
537
+
538
+ # Copied from transformers.models.llama.modeling_llama.rotate_half
539
+ def rotate_half(x):
540
+ """Rotates half the hidden dims of the input."""
541
+ x1 = x[..., : x.shape[-1] // 2]
542
+ x2 = x[..., x.shape[-1] // 2 :]
543
+ return torch.cat((-x2, x1), dim=-1)
544
+
545
+
546
+ # Copied from transformers.models.llama.modeling_llama.apply_rotary_pos_emb
547
+ def apply_rotary_pos_emb(q, k, cos, sin, unsqueeze_dim=1):
548
+ """Applies Rotary Position Embedding to the query and key tensors.
549
+ Args:
550
+ q (`torch.Tensor`): The query tensor.
551
+ k (`torch.Tensor`): The key tensor.
552
+ cos (`torch.Tensor`): The cosine part of the rotary embedding.
553
+ sin (`torch.Tensor`): The sine part of the rotary embedding.
554
+ unsqueeze_dim (`int`, *optional*, defaults to 1):
555
+ The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
556
+ sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
557
+ that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
558
+ k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
559
+ cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
560
+ the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
561
+ Returns:
562
+ `tuple(torch.Tensor)` comprising the query and key tensors rotated using the Rotary Position Embedding.
563
+ """
564
+ cos = cos.unsqueeze(unsqueeze_dim)
565
+ sin = sin.unsqueeze(unsqueeze_dim)
566
+
567
+ # Keep half or full tensor for later concatenation
568
+ rotary_dim = cos.shape[-1]
569
+ q_rot, q_pass = q[..., :rotary_dim], q[..., rotary_dim:]
570
+ k_rot, k_pass = k[..., :rotary_dim], k[..., rotary_dim:]
571
+
572
+ # Apply rotary embeddings on the first half or full tensor
573
+ q_embed = (q_rot * cos) + (rotate_half(q_rot) * sin)
574
+ k_embed = (k_rot * cos) + (rotate_half(k_rot) * sin)
575
+
576
+ # Concatenate back to full shape
577
+ q_embed = torch.cat([q_embed, q_pass], dim=-1)
578
+ k_embed = torch.cat([k_embed, k_pass], dim=-1)
579
+ return q_embed, k_embed
580
+
581
+
582
+ class BailingMoeV2MLP(nn.Module):
583
+ def __init__(self, config: BailingMoeV2Config, intermediate_size: int):
584
+ super().__init__()
585
+ self.config = config
586
+ self.hidden_size = config.hidden_size
587
+ self.intermediate_size = intermediate_size
588
+
589
+ self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
590
+ self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
591
+ self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=False)
592
+ self.act_fn = ACT2FN[config.hidden_act]
593
+
594
+ def forward(self, x):
595
+ return self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
596
+
597
+
598
+ class BailingMoeV2Gate(nn.Module):
599
+ def __init__(self, config):
600
+ super().__init__()
601
+ self.config = config
602
+ self.top_k = config.num_experts_per_tok
603
+ self.num_experts = config.num_experts
604
+
605
+ self.n_group = config.n_group
606
+ self.topk_group = config.topk_group
607
+
608
+ # topk selection algorithm
609
+ self.gating_dim = config.hidden_size
610
+ self.weight = nn.Parameter(torch.empty((self.num_experts, self.gating_dim)))
611
+ self.routed_scaling_factor = config.routed_scaling_factor
612
+
613
+ self.register_buffer("expert_bias", torch.zeros((self.num_experts)))
614
+ self.reset_parameters()
615
+
616
+ def reset_parameters(self) -> None:
617
+ import torch.nn.init as init
618
+
619
+ init.kaiming_uniform_(self.weight, a=math.sqrt(5))
620
+
621
+ def group_limited_topk(
622
+ self,
623
+ scores: torch.Tensor,
624
+ ):
625
+ num_tokens, _ = scores.size()
626
+ # Organize the experts into groups
627
+ group_scores = scores.view(num_tokens, self.n_group, -1).topk(2, dim=-1)[0].sum(dim=-1)
628
+ group_idx = torch.topk(group_scores, k=self.topk_group, dim=-1, sorted=False)[1]
629
+ group_mask = torch.zeros_like(group_scores)
630
+ group_mask.scatter_(1, group_idx, 1)
631
+
632
+ # Mask the experts based on selection groups
633
+ score_mask = (
634
+ group_mask.unsqueeze(-1)
635
+ .expand(num_tokens, self.n_group, self.num_experts // self.n_group)
636
+ .reshape(num_tokens, -1)
637
+ )
638
+
639
+ masked_scores = scores.masked_fill(~score_mask.bool(), float('-inf'))
640
+ probs, top_indices = torch.topk(masked_scores, k=self.top_k, dim=-1)
641
+
642
+ return probs, top_indices
643
+
644
+ def forward(self, hidden_states):
645
+ # compute gating score
646
+ hidden_states = hidden_states.view(-1, hidden_states.shape[-1])
647
+ logits = F.linear(hidden_states.type(torch.float32), self.weight.type(torch.float32))
648
+
649
+ scores = torch.sigmoid(logits.float()).type_as(logits)
650
+
651
+ scores_for_routing = scores + self.expert_bias
652
+ _, topk_idx = self.group_limited_topk(scores_for_routing)
653
+
654
+ scores = torch.gather(scores, dim=1, index=topk_idx).type_as(logits)
655
+
656
+ topk_weight = scores / (scores.sum(dim=-1, keepdim=True) + 1e-20) if self.top_k > 1 else scores
657
+ topk_weight = topk_weight * self.routed_scaling_factor
658
+
659
+ return topk_idx, topk_weight, logits
660
+
661
+
662
+ class BailingMoeV2SparseMoeBlock(nn.Module):
663
+ """
664
+ A mixed expert module containing shared experts.
665
+ """
666
+
667
+ def __init__(self, config: BailingMoeV2Config):
668
+ super().__init__()
669
+ self.config = config
670
+ self.num_experts_per_tok = config.num_experts_per_tok
671
+ self._setup_experts()
672
+ self.gate = BailingMoeV2Gate(config)
673
+ if config.num_shared_experts is not None:
674
+ self.shared_experts = BailingMoeV2MLP(
675
+ config=config, intermediate_size=config.moe_intermediate_size * config.num_shared_experts
676
+ )
677
+
678
+ def _setup_experts(self):
679
+ self.experts = nn.ModuleList(
680
+ [
681
+ BailingMoeV2MLP(config=self.config, intermediate_size=self.config.moe_intermediate_size)
682
+ for _ in range(self.config.num_experts)
683
+ ]
684
+ )
685
+
686
+ def forward(self, hidden_states):
687
+ identity = hidden_states
688
+ bsz, seq_len, h = hidden_states.shape
689
+ topk_idx, topk_weight, router_logits = self.gate(hidden_states)
690
+ hidden_states = hidden_states.view(-1, hidden_states.shape[-1])
691
+ flat_topk_idx = topk_idx.view(-1)
692
+ if self.training:
693
+ hidden_states = hidden_states.repeat_interleave(self.num_experts_per_tok, dim=0)
694
+ y = torch.empty_like(hidden_states)
695
+ for i, expert in enumerate(self.experts):
696
+ y[flat_topk_idx == i] = expert(hidden_states[flat_topk_idx == i])
697
+ y = (y.view(*topk_weight.shape, -1) * topk_weight.unsqueeze(-1)).sum(dim=1)
698
+ y = y.to(hidden_states.dtype).view(bsz, seq_len, h)
699
+ else:
700
+ y = self.moe_infer(hidden_states, topk_idx, topk_weight).view(bsz, seq_len, h)
701
+ if self.config.num_shared_experts is not None:
702
+ y = y + self.shared_experts(identity)
703
+ return y, (router_logits.view(bsz, seq_len, -1), topk_idx.view(bsz, seq_len, -1))
704
+
705
+ @torch.no_grad()
706
+ def moe_infer(self, x, topk_ids, topk_weight):
707
+ cnts = topk_ids.new_zeros((topk_ids.shape[0], len(self.experts)))
708
+ cnts.scatter_(1, topk_ids, 1)
709
+ tokens_per_expert = cnts.sum(dim=0)
710
+ idxs = topk_ids.view(-1).argsort()
711
+ sorted_tokens = x[idxs // topk_ids.shape[1]]
712
+ tokens_per_expert = tokens_per_expert.cpu().numpy()
713
+ outputs = []
714
+ start_idx = 0
715
+ for i, num_tokens in enumerate(tokens_per_expert):
716
+ end_idx = start_idx + num_tokens
717
+ if num_tokens == 0:
718
+ continue
719
+ expert = self.experts[i]
720
+ tokens_for_this_expert = sorted_tokens[start_idx:end_idx]
721
+ expert_out = expert(tokens_for_this_expert)
722
+ outputs.append(expert_out.to(x.device))
723
+ start_idx = end_idx
724
+
725
+ outs = torch.cat(outputs, dim=0) if len(outputs) else sorted_tokens.new_empty(0)
726
+ new_x = torch.empty_like(outs)
727
+ new_x[idxs] = outs
728
+ final_out = (
729
+ new_x.view(*topk_ids.shape, -1)
730
+ .type(topk_weight.dtype)
731
+ .mul_(topk_weight.unsqueeze(dim=-1))
732
+ .sum(dim=1)
733
+ .type(new_x.dtype)
734
+ )
735
+ return final_out
736
+
737
+
738
+ # Copied from transformers.models.llama.modeling_llama.repeat_kv
739
+ def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
740
+ """
741
+ This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
742
+ num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
743
+ """
744
+ batch, num_key_value_heads, slen, head_dim = hidden_states.shape
745
+ if n_rep == 1:
746
+ return hidden_states
747
+ hidden_states = hidden_states[:, :, None, :, :].expand(batch, num_key_value_heads, n_rep, slen, head_dim)
748
+ return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
749
+
750
+
751
+ # Copied from transformers.models.llama.modeling_llama.LlamaAttention with Llama->BailingMoeV2
752
+ class BailingMoeV2Attention(nn.Module):
753
+ """Multi-headed attention from 'Attention Is All You Need' paper"""
754
+
755
+ def __init__(self, config: BailingMoeV2Config, layer_idx: Optional[int] = None):
756
+ super().__init__()
757
+ self.config = config
758
+ self.layer_idx = layer_idx
759
+ if layer_idx is None:
760
+ logger.warning_once(
761
+ f"Instantiating {self.__class__.__name__} without passing `layer_idx` is not recommended and will "
762
+ "to errors during the forward call, if caching is used. Please make sure to provide a `layer_idx` "
763
+ "when creating this class."
764
+ )
765
+
766
+ self.attention_dropout = config.attention_dropout
767
+ self.hidden_size = config.hidden_size
768
+ self.num_heads = config.num_attention_heads
769
+ self.head_dim = config.head_dim or self.hidden_size // self.num_heads
770
+ partial_rotary_factor = config.partial_rotary_factor if hasattr(config, "partial_rotary_factor") else 1.0
771
+ self.rope_dim = int(self.head_dim * partial_rotary_factor)
772
+ self.num_key_value_heads = config.num_key_value_heads
773
+ self.num_key_value_groups = self.num_heads // self.num_key_value_heads
774
+ self.max_position_embeddings = config.max_position_embeddings
775
+ self.rope_theta = config.rope_theta
776
+ self.is_causal = True
777
+
778
+ self.query_key_value = nn.Linear(
779
+ self.hidden_size,
780
+ (self.num_heads + 2 * self.num_key_value_heads) * self.head_dim,
781
+ bias=config.use_qkv_bias,
782
+ )
783
+
784
+ if self.config.use_qk_norm:
785
+ self.query_layernorm = BailingMoeV2RMSNorm(self.head_dim, eps=config.rms_norm_eps)
786
+ self.key_layernorm = BailingMoeV2RMSNorm(self.head_dim, eps=config.rms_norm_eps)
787
+ self.dense = nn.Linear(self.num_heads * self.head_dim, self.hidden_size, bias=config.use_bias)
788
+
789
+ def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
790
+ return tensor.view(bsz, seq_len, self.num_heads, self.head_dim).transpose(1, 2).contiguous()
791
+
792
+ def forward(
793
+ self,
794
+ hidden_states: torch.Tensor,
795
+ attention_mask: Optional[torch.Tensor] = None,
796
+ position_ids: Optional[torch.LongTensor] = None,
797
+ past_key_value: Optional[Cache] = None,
798
+ output_attentions: bool = False,
799
+ use_cache: bool = False,
800
+ position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None, # necessary, but kept here for BC
801
+ **kwargs,
802
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
803
+
804
+ bsz, q_len, _ = hidden_states.size()
805
+
806
+ qkv = self.query_key_value(hidden_states)
807
+ qkv = qkv.view(bsz, q_len, self.num_heads + 2 * self.num_key_value_heads, self.head_dim)
808
+
809
+ query_states, key_states, value_states = qkv.split(
810
+ [self.num_heads, self.num_key_value_heads, self.num_key_value_heads], dim=-2
811
+ )
812
+ query_states = query_states.transpose(1, 2)
813
+ key_states = key_states.transpose(1, 2)
814
+ value_states = value_states.transpose(1, 2)
815
+
816
+ if self.config.use_qk_norm:
817
+ query_states = self.query_layernorm(query_states)
818
+ key_states = self.key_layernorm(key_states)
819
+
820
+ cos, sin = position_embeddings
821
+ query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
822
+
823
+ if past_key_value is not None:
824
+ if self.layer_idx is None:
825
+ raise ValueError(
826
+ f"The cache structure has changed since version v4.36. If you are using {self.__class__.__name__} "
827
+ "for auto-regressive decoding with k/v caching, please make sure to initialize the attention class "
828
+ "with a layer index."
829
+ )
830
+ cache_kwargs = {"sin": sin, "cos": cos}
831
+ key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
832
+
833
+ key_states = repeat_kv(key_states, self.num_key_value_groups)
834
+ value_states = repeat_kv(value_states, self.num_key_value_groups)
835
+
836
+ attn_weights = torch.matmul(query_states, key_states.transpose(2, 3)) / math.sqrt(self.head_dim)
837
+
838
+ kv_seq_len = key_states.shape[-2]
839
+ if attn_weights.size() != (bsz, self.num_heads, q_len, kv_seq_len):
840
+ raise ValueError(
841
+ f"Attention weights should be of size {(bsz, self.num_heads, q_len, kv_seq_len)}, but is"
842
+ f" {attn_weights.size()}"
843
+ )
844
+
845
+ if attention_mask is not None:
846
+ if attention_mask.size() != (bsz, 1, q_len, kv_seq_len):
847
+ raise ValueError(
848
+ f"Attention mask should be of size {(bsz, 1, q_len, kv_seq_len)}, but is {attention_mask.size()}"
849
+ )
850
+ attn_weights = attn_weights + attention_mask
851
+
852
+ # upcast attention to fp32
853
+ attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(query_states.dtype)
854
+ attn_weights = nn.functional.dropout(attn_weights, p=self.attention_dropout, training=self.training)
855
+ attn_output = torch.matmul(attn_weights, value_states)
856
+
857
+ if attn_output.size() != (bsz, self.num_heads, q_len, self.head_dim):
858
+ raise ValueError(
859
+ f"`attn_output` should be of size {(bsz, self.num_heads, q_len, self.head_dim)}, but is"
860
+ f" {attn_output.size()}"
861
+ )
862
+
863
+ attn_output = attn_output.transpose(1, 2).contiguous()
864
+
865
+ attn_output = attn_output.reshape(bsz, q_len, -1)
866
+
867
+ attn_output = self.dense(attn_output)
868
+
869
+ if not output_attentions:
870
+ attn_weights = None
871
+
872
+ return attn_output, attn_weights, past_key_value
873
+
874
+
875
+ # Copied from transformers.models.llama.modeling_llama.LlamaFlashAttention2 with Llama->BailingMoeV2
876
+ class BailingMoeV2FlashAttention2(BailingMoeV2Attention):
877
+ """
878
+ BailingMoeV2 flash attention module. This module inherits from `BailingMoeV2Attention` as the weights of the module stays
879
+ untouched. The only required change would be on the forward pass where it needs to correctly call the public API of
880
+ flash attention and deal with padding tokens in case the input contains any of them.
881
+ """
882
+
883
+ def __init__(self, *args, **kwargs):
884
+ super().__init__(*args, **kwargs)
885
+
886
+ # TODO: Should be removed once Flash Attention for RoCm is bumped to 2.1.
887
+ # flash_attn<2.1 generates top-left aligned causal mask, while what is needed here is bottom-right alignement, that was made default for flash_attn>=2.1. This attribute is used to handle this difference. Reference: https://github.com/Dao-AILab/flash-attention/releases/tag/v2.1.0.
888
+ # Beware that with flash_attn<2.1, using q_seqlen != k_seqlen (except for the case q_seqlen == 1) produces a wrong mask (top-left).
889
+ self._flash_attn_uses_top_left_mask = not is_flash_attn_greater_or_equal_2_10()
890
+
891
+ def forward(
892
+ self,
893
+ hidden_states: torch.Tensor,
894
+ attention_mask: Optional[torch.LongTensor] = None,
895
+ position_ids: Optional[torch.LongTensor] = None,
896
+ past_key_value: Optional[Cache] = None,
897
+ output_attentions: bool = False,
898
+ use_cache: bool = False,
899
+ position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None, # necessary, but kept here for BC
900
+ **kwargs,
901
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
902
+ # BailingMoeV2FlashAttention2 attention does not support output_attentions
903
+ output_attentions = False
904
+
905
+ bsz, q_len, _ = hidden_states.size()
906
+
907
+ # Flash attention requires the input to have the shape
908
+ # batch_size x seq_length x head_dim x hidden_dim
909
+ # therefore we just need to keep the original shape
910
+
911
+ qkv = self.query_key_value(hidden_states)
912
+ qkv = qkv.view(bsz, q_len, self.num_heads + 2 * self.num_key_value_heads, self.head_dim)
913
+
914
+ query_states, key_states, value_states = qkv.split(
915
+ [self.num_heads, self.num_key_value_heads, self.num_key_value_heads], dim=-2
916
+ )
917
+ query_states = query_states.transpose(1, 2)
918
+ key_states = key_states.transpose(1, 2)
919
+ value_states = value_states.transpose(1, 2)
920
+
921
+ if self.config.use_qk_norm:
922
+ query_states = self.query_layernorm(query_states)
923
+ key_states = self.key_layernorm(key_states)
924
+
925
+ cos, sin = position_embeddings
926
+ query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
927
+
928
+ if past_key_value is not None:
929
+ cache_kwargs = {"sin": sin, "cos": cos}
930
+ key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
931
+
932
+ # TODO: These transpose are quite inefficient but Flash Attention requires the layout [batch_size, sequence_length, num_heads, head_dim]. We would need to refactor the KV cache
933
+ # to be able to avoid many of these transpose/reshape/view.
934
+ query_states = query_states.transpose(1, 2)
935
+ key_states = key_states.transpose(1, 2)
936
+ value_states = value_states.transpose(1, 2)
937
+
938
+ dropout_rate = self.attention_dropout if self.training else 0.0
939
+
940
+ # In PEFT, usually we cast the layer norms in float32 for training stability reasons
941
+ # therefore the input hidden states gets silently cast in float32. Hence, we need
942
+ # cast them back in the correct dtype just to be sure everything works as expected.
943
+ # This might slow down training & inference so it is recommended to not cast the LayerNorms
944
+ # in fp32. (BailingMoeV2RMSNorm handles it correctly)
945
+
946
+ input_dtype = query_states.dtype
947
+ if input_dtype == torch.float32:
948
+ # Handle the case where the model is quantized
949
+ if hasattr(self.config, "_pre_quantization_dtype"):
950
+ target_dtype = self.config._pre_quantization_dtype
951
+ elif torch.is_autocast_enabled():
952
+ target_dtype = torch.get_autocast_gpu_dtype()
953
+ else:
954
+ target_dtype = self.query_key_value.weight.dtype
955
+
956
+ logger.warning_once(
957
+ f"The input hidden states seems to be silently casted in float32, this might be related to"
958
+ f" the fact you have upcasted embedding or layer norm layers in float32. We will cast back the input in"
959
+ f" {target_dtype}."
960
+ )
961
+
962
+ query_states = query_states.to(target_dtype)
963
+ key_states = key_states.to(target_dtype)
964
+ value_states = value_states.to(target_dtype)
965
+ if hasattr(self.config, "moba_topk"):
966
+ attn_output = self._mixture_attention_forward(
967
+ query_states, key_states, value_states, attention_mask, q_len, dropout=dropout_rate
968
+ )
969
+ else:
970
+ attn_output = self._flash_attention_forward(
971
+ query_states, key_states, value_states, attention_mask, q_len, dropout=dropout_rate
972
+ )
973
+
974
+ attn_output = attn_output.reshape(bsz, q_len, -1).contiguous()
975
+ attn_output = self.dense(attn_output)
976
+
977
+ if not output_attentions:
978
+ attn_weights = None
979
+
980
+ return attn_output, attn_weights, past_key_value
981
+
982
+ def _mixture_attention_forward(
983
+ self, query_states, key_states, value_states, attention_mask, query_length, dropout=0.0, softmax_scale=None
984
+ ):
985
+ """
986
+ Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token
987
+ first unpad the input, then computes the attention scores and pad the final attention scores.
988
+ Args:
989
+ query_states (`torch.Tensor`):
990
+ Input query states to be passed to Flash Attention API
991
+ key_states (`torch.Tensor`):
992
+ Input key states to be passed to Flash Attention API
993
+ value_states (`torch.Tensor`):
994
+ Input value states to be passed to Flash Attention API
995
+ attention_mask (`torch.Tensor`):
996
+ The padding mask - corresponds to a tensor of size `(batch_size, seq_len)` where 0 stands for the
997
+ position of padding tokens and 1 for the position of non-padding tokens.
998
+ dropout (`int`, *optional*):
999
+ Attention dropout
1000
+ softmax_scale (`float`, *optional*):
1001
+ The scaling of QK^T before applying softmax. Default to 1 / sqrt(head_dim)
1002
+ query_length (`int`):
1003
+ The length of the query sequence in terms of tokens. This represents the number of tokens in the
1004
+ `query_states` tensor along the sequence dimension. It is used to determine the effective sequence
1005
+ length for attention computations.
1006
+ """
1007
+ if not self._flash_attn_uses_top_left_mask:
1008
+ causal = self.is_causal
1009
+ else:
1010
+ # TODO: Remove the `query_length != 1` check once Flash Attention for RoCm is bumped to 2.1. For details, please see the comment in BailingMoeV2FlashAttention2 __init__.
1011
+ causal = self.is_causal and query_length != 1
1012
+
1013
+ if query_length != 1:
1014
+ # prefill
1015
+ # Contains at least one padding token in the sequence
1016
+ if attention_mask is not None:
1017
+ batch_size = query_states.shape[0]
1018
+ query_states, key_states, value_states, indices_q, cu_seq_lens, max_seq_lens = self._upad_input(
1019
+ query_states, key_states, value_states, attention_mask, query_length
1020
+ )
1021
+
1022
+ cu_seqlens_q, cu_seqlens_k = cu_seq_lens
1023
+ max_seqlen_in_batch_q, max_seqlen_in_batch_k = max_seq_lens
1024
+ attn_output_unpad = _moba_attn_varlen_prefill(
1025
+ query_states,
1026
+ key_states,
1027
+ value_states,
1028
+ cu_seqlens=cu_seqlens_k,
1029
+ max_seqlen=max_seqlen_in_batch_k,
1030
+ moba_chunk_size=self.config.moba_block_size,
1031
+ moba_topk=self.config.moba_topk
1032
+ )
1033
+
1034
+ attn_output = pad_input(attn_output_unpad, indices_q, batch_size, query_length)
1035
+ else:
1036
+ batch_size = query_states.shape[0]
1037
+ cu_seqlens_k = torch.cumsum(
1038
+ torch.tensor([0] + [query_length] * batch_size, device=query_states.device),
1039
+ dim=0,
1040
+ dtype=torch.int32,
1041
+ )
1042
+ query_states = query_states.view(-1, self.num_heads, self.head_dim)
1043
+ key_states = key_states.view(-1, self.num_key_value_heads, self.head_dim)
1044
+ value_states = value_states.view(-1, self.num_key_value_heads, self.head_dim)
1045
+ attn_output = _moba_attn_varlen_prefill(
1046
+ query_states,
1047
+ key_states,
1048
+ value_states,
1049
+ cu_seqlens=cu_seqlens_k,
1050
+ max_seqlen=query_length,
1051
+ moba_chunk_size=self.config.moba_block_size,
1052
+ moba_topk=self.config.moba_topk
1053
+ ).view(batch_size, query_length, -1)
1054
+ else:
1055
+ # decode
1056
+ attn_output = self._flash_attention_forward(
1057
+ query_states, key_states, value_states, attention_mask, query_length, dropout, softmax_scale
1058
+ )
1059
+ return attn_output
1060
+
1061
+ def _flash_attention_forward(
1062
+ self, query_states, key_states, value_states, attention_mask, query_length, dropout=0.0, softmax_scale=None
1063
+ ):
1064
+ """
1065
+ Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token
1066
+ first unpad the input, then computes the attention scores and pad the final attention scores.
1067
+ Args:
1068
+ query_states (`torch.Tensor`):
1069
+ Input query states to be passed to Flash Attention API
1070
+ key_states (`torch.Tensor`):
1071
+ Input key states to be passed to Flash Attention API
1072
+ value_states (`torch.Tensor`):
1073
+ Input value states to be passed to Flash Attention API
1074
+ attention_mask (`torch.Tensor`):
1075
+ The padding mask - corresponds to a tensor of size `(batch_size, seq_len)` where 0 stands for the
1076
+ position of padding tokens and 1 for the position of non-padding tokens.
1077
+ dropout (`int`, *optional*):
1078
+ Attention dropout
1079
+ softmax_scale (`float`, *optional*):
1080
+ The scaling of QK^T before applying softmax. Default to 1 / sqrt(head_dim)
1081
+ query_length (`int`):
1082
+ The length of the query sequence in terms of tokens. This represents the number of tokens in the
1083
+ `query_states` tensor along the sequence dimension. It is used to determine the effective sequence
1084
+ length for attention computations.
1085
+ """
1086
+ if not self._flash_attn_uses_top_left_mask:
1087
+ causal = self.is_causal
1088
+ else:
1089
+ # TODO: Remove the `query_length != 1` check once Flash Attention for RoCm is bumped to 2.1. For details, please see the comment in BailingMoeV2FlashAttention2 __init__.
1090
+ causal = self.is_causal and query_length != 1
1091
+
1092
+ # Contains at least one padding token in the sequence
1093
+ if attention_mask is not None:
1094
+ batch_size = query_states.shape[0]
1095
+ query_states, key_states, value_states, indices_q, cu_seq_lens, max_seq_lens = self._upad_input(
1096
+ query_states, key_states, value_states, attention_mask, query_length
1097
+ )
1098
+
1099
+ cu_seqlens_q, cu_seqlens_k = cu_seq_lens
1100
+ max_seqlen_in_batch_q, max_seqlen_in_batch_k = max_seq_lens
1101
+
1102
+ attn_output_unpad = flash_attn_varlen_func(
1103
+ query_states,
1104
+ key_states,
1105
+ value_states,
1106
+ cu_seqlens_q=cu_seqlens_q,
1107
+ cu_seqlens_k=cu_seqlens_k,
1108
+ max_seqlen_q=max_seqlen_in_batch_q,
1109
+ max_seqlen_k=max_seqlen_in_batch_k,
1110
+ dropout_p=dropout,
1111
+ softmax_scale=softmax_scale,
1112
+ causal=causal,
1113
+ )
1114
+
1115
+ attn_output = pad_input(attn_output_unpad, indices_q, batch_size, query_length)
1116
+ else:
1117
+ attn_output = flash_attn_func(
1118
+ query_states, key_states, value_states, dropout, softmax_scale=softmax_scale, causal=causal
1119
+ )
1120
+
1121
+ return attn_output
1122
+
1123
+ def _upad_input(self, query_layer, key_layer, value_layer, attention_mask, query_length):
1124
+ indices_k, cu_seqlens_k, max_seqlen_in_batch_k = _get_unpad_data(attention_mask)
1125
+ batch_size, kv_seq_len, num_key_value_heads, head_dim = key_layer.shape
1126
+
1127
+ key_layer = index_first_axis(
1128
+ key_layer.reshape(batch_size * kv_seq_len, num_key_value_heads, head_dim), indices_k
1129
+ )
1130
+ value_layer = index_first_axis(
1131
+ value_layer.reshape(batch_size * kv_seq_len, num_key_value_heads, head_dim), indices_k
1132
+ )
1133
+ if query_length == kv_seq_len:
1134
+ query_layer = index_first_axis(
1135
+ query_layer.reshape(batch_size * kv_seq_len, self.num_heads, head_dim), indices_k
1136
+ )
1137
+ cu_seqlens_q = cu_seqlens_k
1138
+ max_seqlen_in_batch_q = max_seqlen_in_batch_k
1139
+ indices_q = indices_k
1140
+ elif query_length == 1:
1141
+ max_seqlen_in_batch_q = 1
1142
+ cu_seqlens_q = torch.arange(
1143
+ batch_size + 1, dtype=torch.int32, device=query_layer.device
1144
+ ) # There is a memcpy here, that is very bad.
1145
+ indices_q = cu_seqlens_q[:-1]
1146
+ query_layer = query_layer.squeeze(1)
1147
+ else:
1148
+ # The -q_len: slice assumes left padding.
1149
+ attention_mask = attention_mask[:, -query_length:]
1150
+ query_layer, indices_q, cu_seqlens_q, max_seqlen_in_batch_q = unpad_input(query_layer, attention_mask)
1151
+
1152
+ return (
1153
+ query_layer,
1154
+ key_layer,
1155
+ value_layer,
1156
+ indices_q,
1157
+ (cu_seqlens_q, cu_seqlens_k),
1158
+ (max_seqlen_in_batch_q, max_seqlen_in_batch_k),
1159
+ )
1160
+
1161
+
1162
+ # Copied from transformers.models.llama.modeling_llama.LlamaSdpaAttention with Llama->BailingMoeV2
1163
+ class BailingMoeV2SdpaAttention(BailingMoeV2Attention):
1164
+ """
1165
+ BailingMoeV2 attention module using torch.nn.functional.scaled_dot_product_attention. This module inherits from
1166
+ `BailingMoeV2Attention` as the weights of the module stays untouched. The only changes are on the forward pass to adapt to
1167
+ SDPA API.
1168
+ """
1169
+
1170
+ # Adapted from BailingMoeV2Attention.forward
1171
+ def forward(
1172
+ self,
1173
+ hidden_states: torch.Tensor,
1174
+ attention_mask: Optional[torch.Tensor] = None,
1175
+ position_ids: Optional[torch.LongTensor] = None,
1176
+ past_key_value: Optional[Cache] = None,
1177
+ output_attentions: bool = False,
1178
+ use_cache: bool = False,
1179
+ position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None, # necessary, but kept here for BC
1180
+ **kwargs,
1181
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
1182
+ if output_attentions:
1183
+ # TODO: Improve this warning with e.g. `model.config.attn_implementation = "manual"` once this is implemented.
1184
+ logger.warning_once(
1185
+ "BailingMoeV2Model is using BailingMoeV2SdpaAttention, but `torch.nn.functional.scaled_dot_product_attention` does not support `output_attentions=True`. Falling back to the manual attention implementation, "
1186
+ 'but specifying the manual implementation will be required from Transformers version v5.0.0 onwards. This warning can be removed using the argument `attn_implementation="eager"` when loading the model.'
1187
+ )
1188
+ return super().forward(
1189
+ hidden_states=hidden_states,
1190
+ attention_mask=attention_mask,
1191
+ position_ids=position_ids,
1192
+ past_key_value=past_key_value,
1193
+ output_attentions=output_attentions,
1194
+ use_cache=use_cache,
1195
+ )
1196
+
1197
+ bsz, q_len, _ = hidden_states.size()
1198
+
1199
+ qkv = self.query_key_value(hidden_states)
1200
+ qkv = qkv.view(bsz, q_len, self.num_heads + 2 * self.num_key_value_heads, self.head_dim)
1201
+
1202
+ query_states, key_states, value_states = qkv.split(
1203
+ [self.num_heads, self.num_key_value_heads, self.num_key_value_heads], dim=-2
1204
+ )
1205
+ query_states = query_states.transpose(1, 2)
1206
+ key_states = key_states.transpose(1, 2)
1207
+ value_states = value_states.transpose(1, 2)
1208
+
1209
+ if self.config.use_qk_norm:
1210
+ query_states = self.query_layernorm(query_states)
1211
+ key_states = self.key_layernorm(key_states)
1212
+
1213
+ cos, sin = position_embeddings
1214
+ query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
1215
+
1216
+ if past_key_value is not None:
1217
+ cache_kwargs = {"sin": sin, "cos": cos}
1218
+ key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
1219
+
1220
+ key_states = repeat_kv(key_states, self.num_key_value_groups)
1221
+ value_states = repeat_kv(value_states, self.num_key_value_groups)
1222
+
1223
+ if attention_mask is not None:
1224
+ kv_seq_len = key_states.shape[-2]
1225
+ if attention_mask.size() != (bsz, 1, q_len, kv_seq_len):
1226
+ raise ValueError(
1227
+ f"Attention mask should be of size {(bsz, 1, q_len, kv_seq_len)}, but is {attention_mask.size()}"
1228
+ )
1229
+
1230
+ # SDPA with memory-efficient backend is currently (torch==2.1.2) bugged with non-contiguous inputs with custom attn_mask,
1231
+ # Reference: https://github.com/pytorch/pytorch/issues/112577.
1232
+ if query_states.device.type == "cuda" and attention_mask is not None:
1233
+ query_states = query_states.contiguous()
1234
+ key_states = key_states.contiguous()
1235
+ value_states = value_states.contiguous()
1236
+
1237
+ attn_output = torch.nn.functional.scaled_dot_product_attention(
1238
+ query_states,
1239
+ key_states,
1240
+ value_states,
1241
+ attn_mask=attention_mask,
1242
+ dropout_p=self.attention_dropout if self.training else 0.0,
1243
+ # The q_len > 1 is necessary to match with AttentionMaskConverter.to_causal_4d that does not create a causal mask in case q_len == 1.
1244
+ is_causal=self.is_causal and attention_mask is None and q_len > 1,
1245
+ )
1246
+
1247
+ attn_output = attn_output.transpose(1, 2).contiguous()
1248
+ attn_output = attn_output.reshape(bsz, q_len, -1)
1249
+
1250
+ attn_output = self.dense(attn_output)
1251
+
1252
+ return attn_output, None, past_key_value
1253
+
1254
+
1255
+ ATTENTION_CLASSES = {
1256
+ "eager": BailingMoeV2Attention,
1257
+ "flash_attention_2": BailingMoeV2FlashAttention2,
1258
+ "sdpa": BailingMoeV2SdpaAttention,
1259
+ }
1260
+
1261
+
1262
+ class BailingMoeV2MTPLayer(nn.Module):
1263
+ def __init__(self, config: BailingMoeV2Config, layer_idx: int):
1264
+ super().__init__()
1265
+ self.layer_idx = layer_idx
1266
+ self.input_layernorm = BailingMoeV2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
1267
+ self.enorm = BailingMoeV2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
1268
+
1269
+ self.eh_proj = nn.Linear(config.hidden_size * 2, config.hidden_size, bias=False)
1270
+ self.post_attention_layernorm = BailingMoeV2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
1271
+ self.attention = ATTENTION_CLASSES[config._attn_implementation](config=config, layer_idx=layer_idx)
1272
+ self.mlp = BailingMoeV2SparseMoeBlock(config)
1273
+
1274
+ self.hnorm = BailingMoeV2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
1275
+ self.final_layernorm = BailingMoeV2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
1276
+
1277
+ def forward(
1278
+ self,
1279
+ input_embeds,
1280
+ hidden_states: torch.Tensor,
1281
+ attention_mask: Optional[torch.Tensor] = None,
1282
+ position_ids: Optional[torch.LongTensor] = None,
1283
+ past_key_value: Optional[Tuple[torch.Tensor]] = None,
1284
+ output_attentions: Optional[bool] = False,
1285
+ output_router_logits: Optional[bool] = False,
1286
+ use_cache: Optional[bool] = False,
1287
+ position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None, # necessary, but kept here for BC
1288
+ **kwargs,
1289
+ ) -> Tuple[torch.FloatTensor, Optional[Tuple[torch.FloatTensor, torch.FloatTensor]]]:
1290
+ input_embeds = self.enorm(input_embeds)
1291
+ hidden_states = self.hnorm(hidden_states)
1292
+ hidden_states = self.eh_proj(torch.cat([input_embeds, hidden_states], dim=-1))
1293
+ residual = hidden_states
1294
+
1295
+ hidden_states = self.input_layernorm(hidden_states)
1296
+
1297
+ # Self Attention
1298
+ hidden_states, self_attn_weights, present_key_value = self.attention(
1299
+ hidden_states=hidden_states,
1300
+ attention_mask=attention_mask,
1301
+ position_ids=position_ids,
1302
+ past_key_value=past_key_value,
1303
+ output_attentions=output_attentions,
1304
+ position_embeddings=position_embeddings,
1305
+ use_cache=use_cache,
1306
+ )
1307
+ hidden_states = residual + hidden_states
1308
+
1309
+ # Fully Connected
1310
+ residual = hidden_states
1311
+ hidden_states = self.post_attention_layernorm(hidden_states)
1312
+ hidden_states = self.mlp(hidden_states)
1313
+ if isinstance(hidden_states, tuple):
1314
+ hidden_states, router_logits = hidden_states
1315
+ else:
1316
+ router_logits = None
1317
+ hidden_states = residual + hidden_states.to(residual.device)
1318
+ hidden_states = self.final_layernorm(hidden_states)
1319
+
1320
+ outputs = (hidden_states,)
1321
+
1322
+ if output_attentions:
1323
+ outputs += (self_attn_weights,)
1324
+
1325
+ if use_cache:
1326
+ outputs += (present_key_value,)
1327
+
1328
+ if output_router_logits:
1329
+ outputs += (router_logits,)
1330
+
1331
+ return outputs
1332
+
1333
+
1334
+ class BailingMoeV2DecoderLayer(nn.Module):
1335
+ def __init__(self, config: BailingMoeV2Config, layer_idx: int):
1336
+ super().__init__()
1337
+ self.hidden_size = config.hidden_size
1338
+
1339
+ self.attention = ATTENTION_CLASSES[config._attn_implementation](config=config, layer_idx=layer_idx)
1340
+
1341
+ self.mlp = (
1342
+ BailingMoeV2SparseMoeBlock(config)
1343
+ if (config.num_experts is not None and layer_idx >= config.first_k_dense_replace)
1344
+ else BailingMoeV2MLP(config=config, intermediate_size=config.intermediate_size)
1345
+ )
1346
+ self.input_layernorm = BailingMoeV2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
1347
+ self.post_attention_layernorm = BailingMoeV2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
1348
+
1349
+ def forward(
1350
+ self,
1351
+ hidden_states: torch.Tensor,
1352
+ attention_mask: Optional[torch.Tensor] = None,
1353
+ position_ids: Optional[torch.LongTensor] = None,
1354
+ past_key_value: Optional[Tuple[torch.Tensor]] = None,
1355
+ output_attentions: Optional[bool] = False,
1356
+ output_router_logits: Optional[bool] = False,
1357
+ use_cache: Optional[bool] = False,
1358
+ position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None, # necessary, but kept here for BC
1359
+ **kwargs,
1360
+ ) -> Tuple[torch.FloatTensor, Optional[Tuple[torch.FloatTensor, torch.FloatTensor]]]:
1361
+ """
1362
+ Args:
1363
+ hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)`
1364
+ attention_mask (`torch.FloatTensor`, *optional*):
1365
+ attention mask of size `(batch_size, sequence_length)` if flash attention is used or `(batch_size, 1,
1366
+ query_sequence_length, key_sequence_length)` if default attention is used.
1367
+ position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
1368
+ Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
1369
+ config.n_positions - 1]`.
1370
+ past_key_value (`Tuple(torch.FloatTensor)`, *optional*):
1371
+ cached past key and value projection states
1372
+ output_attentions (`bool`, *optional*):
1373
+ Whether to return the attentions tensors of all attention layers. See `attentions` under
1374
+ returned tensors for more detail.
1375
+ output_router_logits (`bool`, *optional*):
1376
+ Whether or not to return the logits of all the routers. They are useful for computing the router loss,
1377
+ and should not be returned during inference.
1378
+ use_cache (`bool`, *optional*):
1379
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding
1380
+ (see `past_key_values`).
1381
+ """
1382
+ residual = hidden_states
1383
+
1384
+ hidden_states = self.input_layernorm(hidden_states)
1385
+
1386
+ # Self Attention
1387
+ hidden_states, self_attn_weights, present_key_value = self.attention(
1388
+ hidden_states=hidden_states,
1389
+ attention_mask=attention_mask,
1390
+ position_ids=position_ids,
1391
+ past_key_value=past_key_value,
1392
+ output_attentions=output_attentions,
1393
+ position_embeddings=position_embeddings,
1394
+ use_cache=use_cache,
1395
+ )
1396
+ hidden_states = residual + hidden_states
1397
+
1398
+ # Fully Connected
1399
+ residual = hidden_states
1400
+ hidden_states = self.post_attention_layernorm(hidden_states)
1401
+ hidden_states = self.mlp(hidden_states)
1402
+ if isinstance(hidden_states, tuple):
1403
+ hidden_states, router_logits = hidden_states
1404
+ else:
1405
+ router_logits = None
1406
+ hidden_states = residual + hidden_states.to(residual.device)
1407
+
1408
+ outputs = (hidden_states,)
1409
+
1410
+ if output_attentions:
1411
+ outputs += (self_attn_weights,)
1412
+
1413
+ if use_cache:
1414
+ outputs += (present_key_value,)
1415
+
1416
+ if output_router_logits:
1417
+ outputs += (router_logits,)
1418
+
1419
+ return outputs
1420
+
1421
+
1422
+ BAILINGMOEV2_START_DOCSTRING = r"""
1423
+ This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
1424
+ library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
1425
+ etc.)
1426
+ This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
1427
+ Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
1428
+ and behavior.
1429
+ Parameters:
1430
+ config ([`BailingMoeV2Config`]):
1431
+ Model configuration class with all the parameters of the model. Initializing with a config file does not
1432
+ load the weights associated with the model, only the configuration. Check out the
1433
+ [`~PreTrainedModel.from_pretrained`] method to load the model weights.
1434
+ """
1435
+
1436
+
1437
+ @add_start_docstrings(
1438
+ "The bare BailingMoeV2 Model outputting raw hidden-states without any specific head on top.",
1439
+ BAILINGMOEV2_START_DOCSTRING,
1440
+ )
1441
+ class BailingMoeV2PreTrainedModel(PreTrainedModel):
1442
+ config_class = BailingMoeV2Config
1443
+ base_model_prefix = "model"
1444
+ supports_gradient_checkpointing = True
1445
+ _no_split_modules = ["BailingMoeV2DecoderLayer"]
1446
+ _skip_keys_device_placement = "past_key_values"
1447
+ _supports_flash_attn_2 = True
1448
+ _supports_sdpa = True
1449
+ _supports_cache_class = True
1450
+
1451
+ def _init_weights(self, module):
1452
+ std = self.config.initializer_range
1453
+ if isinstance(module, nn.Linear):
1454
+ module.weight.data.normal_(mean=0.0, std=std)
1455
+ if module.bias is not None:
1456
+ module.bias.data.zero_()
1457
+ elif isinstance(module, nn.Embedding):
1458
+ module.weight.data.normal_(mean=0.0, std=std)
1459
+ if module.padding_idx is not None:
1460
+ module.weight.data[module.padding_idx].zero_()
1461
+
1462
+
1463
+ BAILINGMOEV2_INPUTS_DOCSTRING = r"""
1464
+ Args:
1465
+ input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
1466
+ Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
1467
+ it.
1468
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
1469
+ [`PreTrainedTokenizer.__call__`] for details.
1470
+ [What are input IDs?](../glossary#input-ids)
1471
+ attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
1472
+ Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
1473
+ - 1 for tokens that are **not masked**,
1474
+ - 0 for tokens that are **masked**.
1475
+ [What are attention masks?](../glossary#attention-mask)
1476
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
1477
+ [`PreTrainedTokenizer.__call__`] for details.
1478
+ If `past_key_values` is used, optionally only the last `input_ids` have to be input (see
1479
+ `past_key_values`).
1480
+ If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_attention_mask`]
1481
+ and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
1482
+ information on the default strategy.
1483
+ - 1 indicates the head is **not masked**,
1484
+ - 0 indicates the head is **masked**.
1485
+ position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
1486
+ Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
1487
+ config.n_positions - 1]`.
1488
+ [What are position IDs?](../glossary#position-ids)
1489
+ past_key_values (`Cache` or `tuple(tuple(torch.FloatTensor))`, *optional*):
1490
+ Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
1491
+ blocks) that can be used to speed up sequential decoding. This typically consists in the `past_key_values`
1492
+ returned by the model at a previous stage of decoding, when `use_cache=True` or `config.use_cache=True`.
1493
+ Two formats are allowed:
1494
+ - a [`~cache_utils.Cache`] instance;
1495
+ - Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of
1496
+ shape `(batch_size, num_heads, sequence_length, embed_size_per_head)`). This is also known as the legacy
1497
+ cache format.
1498
+ The model will output the same cache format that is fed as input. If no `past_key_values` are passed, the
1499
+ legacy cache format will be returned.
1500
+ If `past_key_values` are used, the user can optionally input only the last `input_ids` (those that don't
1501
+ have their past key value states given to this model) of shape `(batch_size, 1)` instead of all `input_ids`
1502
+ of shape `(batch_size, sequence_length)`.
1503
+ inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
1504
+ Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
1505
+ is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
1506
+ model's internal embedding lookup matrix.
1507
+ use_cache (`bool`, *optional*):
1508
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
1509
+ `past_key_values`).
1510
+ output_attentions (`bool`, *optional*):
1511
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
1512
+ tensors for more detail.
1513
+ output_hidden_states (`bool`, *optional*):
1514
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
1515
+ more detail.
1516
+ return_dict (`bool`, *optional*):
1517
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
1518
+ """
1519
+
1520
+
1521
+ @add_start_docstrings(
1522
+ "The bare BailingMoeV2 Model outputting raw hidden-states without any specific head on top.",
1523
+ BAILINGMOEV2_START_DOCSTRING,
1524
+ )
1525
+ class BailingMoeV2Model(BailingMoeV2PreTrainedModel):
1526
+ """
1527
+ Transformer decoder consisting of *config.num_hidden_layers* layers. Each layer is a [`BailingMoeV2DecoderLayer`]
1528
+ Args:
1529
+ config: BailingMoeV2Config
1530
+ """
1531
+
1532
+ def __init__(self, config: BailingMoeV2Config):
1533
+ super().__init__(config)
1534
+ self.padding_idx = config.pad_token_id
1535
+ self.vocab_size = config.vocab_size
1536
+ self.num_nextn_predict_layers = config.num_nextn_predict_layers
1537
+
1538
+ self.word_embeddings = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
1539
+ self.layers = []
1540
+ for layer_idx in range(config.num_hidden_layers + config.num_nextn_predict_layers):
1541
+ layer_cls = BailingMoeV2DecoderLayer if layer_idx < config.num_hidden_layers else BailingMoeV2MTPLayer
1542
+ self.layers.append(layer_cls(config, layer_idx))
1543
+
1544
+ self.layers = nn.ModuleList(self.layers)
1545
+
1546
+ self._use_sdpa = config._attn_implementation == "sdpa"
1547
+ self._use_flash_attention_2 = config._attn_implementation == "flash_attention_2"
1548
+ self.norm = BailingMoeV2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
1549
+ self.rotary_emb = BailingMoeV2RotaryEmbedding(config=config)
1550
+ self.gradient_checkpointing = False
1551
+ # Initialize weights and apply final processing
1552
+ self.post_init()
1553
+
1554
+ def get_input_embeddings(self):
1555
+ return self.word_embeddings
1556
+
1557
+ def set_input_embeddings(self, value):
1558
+ self.word_embeddings = value
1559
+
1560
+ @add_start_docstrings_to_model_forward(BAILINGMOEV2_INPUTS_DOCSTRING)
1561
+ def forward(
1562
+ self,
1563
+ input_ids: torch.LongTensor = None,
1564
+ attention_mask: Optional[torch.Tensor] = None,
1565
+ position_ids: Optional[torch.LongTensor] = None,
1566
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
1567
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1568
+ use_cache: Optional[bool] = None,
1569
+ output_attentions: Optional[bool] = None,
1570
+ output_hidden_states: Optional[bool] = None,
1571
+ output_router_logits: Optional[bool] = None,
1572
+ return_dict: Optional[bool] = None,
1573
+ **kwargs,
1574
+ ) -> Union[Tuple, MoeV2ModelOutputWithPast]:
1575
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
1576
+ output_hidden_states = (
1577
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
1578
+ )
1579
+ output_router_logits = (
1580
+ output_router_logits if output_router_logits is not None else self.config.output_router_logits
1581
+ )
1582
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
1583
+
1584
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1585
+
1586
+ # retrieve input_ids and inputs_embeds
1587
+ if input_ids is not None and inputs_embeds is not None:
1588
+ raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
1589
+ elif input_ids is not None:
1590
+ batch_size, seq_length = input_ids.shape[:2]
1591
+ elif inputs_embeds is not None:
1592
+ batch_size, seq_length = inputs_embeds.shape[:2]
1593
+ else:
1594
+ raise ValueError("You have to specify either input_ids or inputs_embeds")
1595
+
1596
+ if self.gradient_checkpointing and self.training:
1597
+ if use_cache:
1598
+ logger.warning_once(
1599
+ "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`transformers."
1600
+ )
1601
+ use_cache = False
1602
+
1603
+ if use_cache and past_key_values is None:
1604
+ past_key_values = DynamicCache()
1605
+
1606
+ if inputs_embeds is None:
1607
+ inputs_embeds = self.word_embeddings(input_ids)
1608
+
1609
+ past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
1610
+
1611
+ if position_ids is None:
1612
+ position_ids = torch.arange(
1613
+ past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
1614
+ )
1615
+ position_ids = position_ids.unsqueeze(0)
1616
+
1617
+ if self._use_flash_attention_2:
1618
+ # 2d mask is passed through the layers
1619
+ attention_mask = attention_mask if (attention_mask is not None and 0 in attention_mask) else None
1620
+ elif self._use_sdpa and not output_attentions:
1621
+ # output_attentions=True can not be supported when using SDPA, and we fall back on
1622
+ # the manual implementation that requires a 4D causal mask in all cases.
1623
+ attention_mask = _prepare_4d_causal_attention_mask_for_sdpa(
1624
+ attention_mask,
1625
+ (batch_size, seq_length),
1626
+ inputs_embeds,
1627
+ past_seen_tokens,
1628
+ )
1629
+ else:
1630
+ # 4d mask is passed through the layers
1631
+ attention_mask = _prepare_4d_causal_attention_mask(
1632
+ attention_mask, (batch_size, seq_length), inputs_embeds, past_seen_tokens
1633
+ )
1634
+
1635
+ # embed positions
1636
+ hidden_states = inputs_embeds
1637
+
1638
+ # create position embeddings to be shared across the decoder layers
1639
+ position_embeddings = self.rotary_emb(hidden_states, position_ids)
1640
+
1641
+ # decoder layers
1642
+ all_hidden_states = () if output_hidden_states else None
1643
+ all_self_attns = () if output_attentions else None
1644
+ all_router_logits = () if output_router_logits else None
1645
+ next_decoder_cache = None
1646
+ layers = self.layers[: -self.num_nextn_predict_layers] if self.num_nextn_predict_layers > 0 else self.layers
1647
+ mtp_layers = self.layers[-self.num_nextn_predict_layers :] if self.num_nextn_predict_layers > 0 else None
1648
+
1649
+ for decoder_layer in layers:
1650
+ if output_hidden_states:
1651
+ all_hidden_states += (hidden_states,)
1652
+
1653
+ if self.gradient_checkpointing and self.training:
1654
+ layer_outputs = self._gradient_checkpointing_func(
1655
+ decoder_layer.__call__,
1656
+ hidden_states,
1657
+ attention_mask,
1658
+ position_ids,
1659
+ past_key_values,
1660
+ output_attentions,
1661
+ output_router_logits,
1662
+ use_cache,
1663
+ position_embeddings,
1664
+ )
1665
+ else:
1666
+ layer_outputs = decoder_layer(
1667
+ hidden_states,
1668
+ attention_mask=attention_mask,
1669
+ position_ids=position_ids,
1670
+ past_key_value=past_key_values,
1671
+ output_attentions=output_attentions,
1672
+ output_router_logits=output_router_logits,
1673
+ use_cache=use_cache,
1674
+ position_embeddings=position_embeddings,
1675
+ )
1676
+ hidden_states = layer_outputs[0]
1677
+
1678
+ if use_cache:
1679
+ next_decoder_cache = layer_outputs[2 if output_attentions else 1]
1680
+
1681
+ if output_attentions:
1682
+ all_self_attns += (layer_outputs[1],)
1683
+
1684
+ if output_router_logits and layer_outputs[-1] is not None:
1685
+ all_router_logits += (layer_outputs[-1],)
1686
+
1687
+ hidden_states = self.norm(hidden_states)
1688
+ main_hidden_states = hidden_states
1689
+
1690
+ # add hidden states from the last decoder layer
1691
+ if output_hidden_states:
1692
+ all_hidden_states += (main_hidden_states,)
1693
+
1694
+ mtp_hidden_states = None
1695
+
1696
+ if mtp_layers:
1697
+ for decoder_layer in mtp_layers:
1698
+ input_ids, _ = roll_tensor(input_ids, shifts=-1, dims=-1)
1699
+ inputs_embeds = self.word_embeddings(input_ids)
1700
+
1701
+ if self.gradient_checkpointing and self.training:
1702
+ layer_outputs = self._gradient_checkpointing_func(
1703
+ decoder_layer.__call__,
1704
+ inputs_embeds,
1705
+ hidden_states,
1706
+ attention_mask,
1707
+ position_ids,
1708
+ past_key_values,
1709
+ output_attentions,
1710
+ output_router_logits,
1711
+ use_cache,
1712
+ position_embeddings,
1713
+ )
1714
+ else:
1715
+ layer_outputs = decoder_layer(
1716
+ inputs_embeds,
1717
+ hidden_states,
1718
+ attention_mask=attention_mask,
1719
+ position_ids=position_ids,
1720
+ past_key_value=past_key_values,
1721
+ output_attentions=output_attentions,
1722
+ output_router_logits=output_router_logits,
1723
+ use_cache=use_cache,
1724
+ position_embeddings=position_embeddings,
1725
+ )
1726
+ if mtp_hidden_states is None:
1727
+ mtp_hidden_states = []
1728
+ hidden_states = layer_outputs[0]
1729
+ mtp_hidden_states.append(hidden_states)
1730
+
1731
+ if output_hidden_states:
1732
+ all_hidden_states += (hidden_states,)
1733
+
1734
+ if use_cache:
1735
+ next_decoder_cache = layer_outputs[2 if output_attentions else 1]
1736
+
1737
+ if output_attentions:
1738
+ all_self_attns += (layer_outputs[1],)
1739
+
1740
+ if output_router_logits and layer_outputs[-1] is not None:
1741
+ all_router_logits += (layer_outputs[-1],)
1742
+
1743
+ next_cache = None
1744
+ if use_cache:
1745
+ next_cache = next_decoder_cache
1746
+ if not return_dict:
1747
+ return tuple(
1748
+ v
1749
+ for v in [main_hidden_states, next_cache, all_hidden_states, all_self_attns, all_router_logits]
1750
+ if v is not None
1751
+ )
1752
+ return MoeV2ModelOutputWithPast(
1753
+ last_hidden_state=main_hidden_states,
1754
+ past_key_values=next_cache,
1755
+ hidden_states=all_hidden_states,
1756
+ mtp_hidden_states=mtp_hidden_states,
1757
+ attentions=all_self_attns,
1758
+ router_logits=all_router_logits,
1759
+ )
1760
+
1761
+
1762
+ class BailingMoeV2ForCausalLM(BailingMoeV2PreTrainedModel, GenerationMixin):
1763
+ _tied_weights_keys = ["lm_head.weight"]
1764
+
1765
+ def __init__(self, config: BailingMoeV2Config):
1766
+ super().__init__(config)
1767
+ self.model = BailingMoeV2Model(config)
1768
+ self.vocab_size = config.vocab_size
1769
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
1770
+ self.num_nextn_predict_layers = config.num_nextn_predict_layers
1771
+ self.mtp_loss_scaling_factor = config.mtp_loss_scaling_factor
1772
+
1773
+ # Initialize weights and apply final processing
1774
+ self.post_init()
1775
+
1776
+ def get_input_embeddings(self):
1777
+ return self.model.word_embeddings
1778
+
1779
+ def set_input_embeddings(self, value):
1780
+ self.model.word_embeddings = value
1781
+
1782
+ def get_output_embeddings(self):
1783
+ return self.lm_head
1784
+
1785
+ def set_output_embeddings(self, new_embeddings):
1786
+ self.lm_head = new_embeddings
1787
+
1788
+ def set_decoder(self, decoder):
1789
+ self.model = decoder
1790
+
1791
+ def get_decoder(self):
1792
+ return self.model
1793
+
1794
+ @add_start_docstrings_to_model_forward(BAILINGMOEV2_INPUTS_DOCSTRING)
1795
+ @replace_return_docstrings(output_type=MoEV2CausalLMOutputWithPast, config_class=_CONFIG_FOR_DOC)
1796
+ def forward(
1797
+ self,
1798
+ input_ids: torch.LongTensor = None,
1799
+ attention_mask: Optional[torch.Tensor] = None,
1800
+ position_ids: Optional[torch.LongTensor] = None,
1801
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
1802
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1803
+ labels: Optional[torch.LongTensor] = None,
1804
+ use_cache: Optional[bool] = None,
1805
+ output_attentions: Optional[bool] = None,
1806
+ output_hidden_states: Optional[bool] = None,
1807
+ output_router_logits: Optional[bool] = None,
1808
+ return_dict: Optional[bool] = None,
1809
+ **kwargs,
1810
+ ) -> Union[Tuple, MoEV2CausalLMOutputWithPast]:
1811
+ r"""
1812
+ Args:
1813
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
1814
+ Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
1815
+ config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
1816
+ (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
1817
+ Returns:
1818
+ Example:
1819
+ ```python
1820
+ >>> from transformers import AutoTokenizer
1821
+ >>> model = BailingMoeV2ForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
1822
+ >>> tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)
1823
+ >>> prompt = "Hey, are you conscious? Can you talk to me?"
1824
+ >>> inputs = tokenizer(prompt, return_tensors="pt")
1825
+ >>> # Generate
1826
+ >>> generate_ids = model.generate(inputs.input_ids, max_length=30)
1827
+ >>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
1828
+ "Hey, are you conscious? Can you talk to me?\nI'm not conscious, but I can talk to you."
1829
+ ```"""
1830
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
1831
+ output_hidden_states = (
1832
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
1833
+ )
1834
+ output_router_logits = (
1835
+ output_router_logits if output_router_logits is not None else self.config.output_router_logits
1836
+ )
1837
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1838
+ # decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
1839
+ outputs = self.model(
1840
+ input_ids=input_ids,
1841
+ attention_mask=attention_mask,
1842
+ position_ids=position_ids,
1843
+ past_key_values=past_key_values,
1844
+ inputs_embeds=inputs_embeds,
1845
+ use_cache=use_cache,
1846
+ output_attentions=output_attentions,
1847
+ output_hidden_states=output_hidden_states,
1848
+ output_router_logits=output_router_logits,
1849
+ return_dict=return_dict,
1850
+ **kwargs,
1851
+ )
1852
+
1853
+ loss = None
1854
+ all_mtp_loss = None
1855
+ aux_loss = None
1856
+ hidden_states = outputs[0]
1857
+ logits = self.lm_head(hidden_states)
1858
+ logits = logits.float()
1859
+
1860
+ if labels is not None:
1861
+ loss = self.loss_function(logits, labels, self.config.vocab_size, **kwargs)
1862
+
1863
+ all_mtp_logits = None
1864
+ if self.num_nextn_predict_layers > 0:
1865
+ mtp_hidden_states = outputs.mtp_hidden_states
1866
+ shift_labels_mtp = None
1867
+ for i in range(self.num_nextn_predict_layers):
1868
+ mtp_hidden_states = mtp_hidden_states[i]
1869
+ mtp_logits = self.lm_head(mtp_hidden_states).float()
1870
+ if all_mtp_logits is None:
1871
+ all_mtp_logits = []
1872
+ all_mtp_logits.append(mtp_logits)
1873
+ if labels is not None:
1874
+ if shift_labels_mtp is None:
1875
+ shift_labels_mtp = labels.clone()
1876
+ shift_labels_mtp, _ = roll_tensor(shift_labels_mtp, shifts=-1, dims=-1, fill_value=-100)
1877
+ mtp_logits_ = mtp_logits.view(-1, self.config.vocab_size)
1878
+ mtp_loss = self.loss_function(mtp_logits_, shift_labels_mtp.to(mtp_logits_.device).view(-1), self.config.vocab_size, **kwargs)
1879
+ if loss is not None:
1880
+ loss += self.mtp_loss_scaling_factor * mtp_loss
1881
+ else:
1882
+ loss = self.mtp_loss_scaling_factor * mtp_loss
1883
+
1884
+ if all_mtp_loss is None:
1885
+ all_mtp_loss = []
1886
+ all_mtp_loss.append(mtp_loss)
1887
+
1888
+ if not return_dict:
1889
+ output = (logits,) + outputs[1:]
1890
+ if output_router_logits:
1891
+ output = (aux_loss,) + output
1892
+ return (loss,) + output if loss is not None else output
1893
+
1894
+ return MoEV2CausalLMOutputWithPast(
1895
+ loss=loss,
1896
+ mtp_loss=all_mtp_loss,
1897
+ aux_loss=aux_loss,
1898
+ logits=logits,
1899
+ mtp_logits=all_mtp_logits,
1900
+ past_key_values=outputs.past_key_values,
1901
+ hidden_states=outputs.hidden_states,
1902
+ attentions=outputs.attentions,
1903
+ router_logits=outputs.router_logits,
1904
+ )
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|startoftext|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "[CLS]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "<|endoftext|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "pad_token": {
24
+ "content": "<|endoftext|>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdcadf59ad1db38dde175f2a82d3ec2dde15986ac1f81aef69c5cdd03afc6e1b
3
+ size 12205847
tokenizer_config.json ADDED
@@ -0,0 +1,2114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "156891": {
6
+ "content": "<|startoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "156892": {
14
+ "content": "<|endoftext|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "156893": {
22
+ "content": "[CLS]",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "156894": {
30
+ "content": "[gMASK]",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "156895": {
38
+ "content": "<|reserved_token_0|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "156896": {
46
+ "content": "<|reserved_token_1|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "156897": {
54
+ "content": "<|reserved_token_2|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "156898": {
62
+ "content": "<|reserved_token_3|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "156899": {
70
+ "content": "<|reserved_token_4|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "156900": {
78
+ "content": "<|reserved_token_5|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "156901": {
86
+ "content": "<|reserved_token_6|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "156902": {
94
+ "content": "<|reserved_token_7|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "156903": {
102
+ "content": "<|reserved_token_8|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "156904": {
110
+ "content": "<|reserved_token_9|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "156905": {
118
+ "content": "<|reserved_token_10|>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": true
124
+ },
125
+ "156906": {
126
+ "content": "<|reserved_token_11|>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": true
132
+ },
133
+ "156907": {
134
+ "content": "<|reserved_token_12|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": true
140
+ },
141
+ "156908": {
142
+ "content": "<|reserved_token_13|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": true
148
+ },
149
+ "156909": {
150
+ "content": "<|reserved_token_14|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": true
156
+ },
157
+ "156910": {
158
+ "content": "<|reserved_token_15|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": true
164
+ },
165
+ "156911": {
166
+ "content": "<|reserved_token_16|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": true
172
+ },
173
+ "156912": {
174
+ "content": "<|reserved_token_17|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": true
180
+ },
181
+ "156913": {
182
+ "content": "<|reserved_token_18|>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": true
188
+ },
189
+ "156914": {
190
+ "content": "<|reserved_token_19|>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": true
196
+ },
197
+ "156915": {
198
+ "content": "<|reserved_token_20|>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": true
204
+ },
205
+ "156916": {
206
+ "content": "<|reserved_token_21|>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": true
212
+ },
213
+ "156917": {
214
+ "content": "<|reserved_token_22|>",
215
+ "lstrip": false,
216
+ "normalized": false,
217
+ "rstrip": false,
218
+ "single_word": false,
219
+ "special": true
220
+ },
221
+ "156918": {
222
+ "content": "<|reserved_token_23|>",
223
+ "lstrip": false,
224
+ "normalized": false,
225
+ "rstrip": false,
226
+ "single_word": false,
227
+ "special": true
228
+ },
229
+ "156919": {
230
+ "content": "<|reserved_token_24|>",
231
+ "lstrip": false,
232
+ "normalized": false,
233
+ "rstrip": false,
234
+ "single_word": false,
235
+ "special": true
236
+ },
237
+ "156920": {
238
+ "content": "<|reserved_token_25|>",
239
+ "lstrip": false,
240
+ "normalized": false,
241
+ "rstrip": false,
242
+ "single_word": false,
243
+ "special": true
244
+ },
245
+ "156921": {
246
+ "content": "<|reserved_token_26|>",
247
+ "lstrip": false,
248
+ "normalized": false,
249
+ "rstrip": false,
250
+ "single_word": false,
251
+ "special": true
252
+ },
253
+ "156922": {
254
+ "content": "<|reserved_token_27|>",
255
+ "lstrip": false,
256
+ "normalized": false,
257
+ "rstrip": false,
258
+ "single_word": false,
259
+ "special": true
260
+ },
261
+ "156923": {
262
+ "content": "<|reserved_token_28|>",
263
+ "lstrip": false,
264
+ "normalized": false,
265
+ "rstrip": false,
266
+ "single_word": false,
267
+ "special": true
268
+ },
269
+ "156924": {
270
+ "content": "<|reserved_token_29|>",
271
+ "lstrip": false,
272
+ "normalized": false,
273
+ "rstrip": false,
274
+ "single_word": false,
275
+ "special": true
276
+ },
277
+ "156925": {
278
+ "content": "<|reserved_token_30|>",
279
+ "lstrip": false,
280
+ "normalized": false,
281
+ "rstrip": false,
282
+ "single_word": false,
283
+ "special": true
284
+ },
285
+ "156926": {
286
+ "content": "<|reserved_token_31|>",
287
+ "lstrip": false,
288
+ "normalized": false,
289
+ "rstrip": false,
290
+ "single_word": false,
291
+ "special": true
292
+ },
293
+ "156927": {
294
+ "content": "<|reserved_token_32|>",
295
+ "lstrip": false,
296
+ "normalized": false,
297
+ "rstrip": false,
298
+ "single_word": false,
299
+ "special": true
300
+ },
301
+ "156928": {
302
+ "content": "<|reserved_token_33|>",
303
+ "lstrip": false,
304
+ "normalized": false,
305
+ "rstrip": false,
306
+ "single_word": false,
307
+ "special": true
308
+ },
309
+ "156929": {
310
+ "content": "<|reserved_token_34|>",
311
+ "lstrip": false,
312
+ "normalized": false,
313
+ "rstrip": false,
314
+ "single_word": false,
315
+ "special": true
316
+ },
317
+ "156930": {
318
+ "content": "<|reserved_token_35|>",
319
+ "lstrip": false,
320
+ "normalized": false,
321
+ "rstrip": false,
322
+ "single_word": false,
323
+ "special": true
324
+ },
325
+ "156931": {
326
+ "content": "<|reserved_token_36|>",
327
+ "lstrip": false,
328
+ "normalized": false,
329
+ "rstrip": false,
330
+ "single_word": false,
331
+ "special": true
332
+ },
333
+ "156932": {
334
+ "content": "<|reserved_token_37|>",
335
+ "lstrip": false,
336
+ "normalized": false,
337
+ "rstrip": false,
338
+ "single_word": false,
339
+ "special": true
340
+ },
341
+ "156933": {
342
+ "content": "<|reserved_token_38|>",
343
+ "lstrip": false,
344
+ "normalized": false,
345
+ "rstrip": false,
346
+ "single_word": false,
347
+ "special": true
348
+ },
349
+ "156934": {
350
+ "content": "<|reserved_token_39|>",
351
+ "lstrip": false,
352
+ "normalized": false,
353
+ "rstrip": false,
354
+ "single_word": false,
355
+ "special": true
356
+ },
357
+ "156935": {
358
+ "content": "<|reserved_token_40|>",
359
+ "lstrip": false,
360
+ "normalized": false,
361
+ "rstrip": false,
362
+ "single_word": false,
363
+ "special": true
364
+ },
365
+ "156936": {
366
+ "content": "<|reserved_token_41|>",
367
+ "lstrip": false,
368
+ "normalized": false,
369
+ "rstrip": false,
370
+ "single_word": false,
371
+ "special": true
372
+ },
373
+ "156937": {
374
+ "content": "<|reserved_token_42|>",
375
+ "lstrip": false,
376
+ "normalized": false,
377
+ "rstrip": false,
378
+ "single_word": false,
379
+ "special": true
380
+ },
381
+ "156938": {
382
+ "content": "<|reserved_token_43|>",
383
+ "lstrip": false,
384
+ "normalized": false,
385
+ "rstrip": false,
386
+ "single_word": false,
387
+ "special": true
388
+ },
389
+ "156939": {
390
+ "content": "<|reserved_token_44|>",
391
+ "lstrip": false,
392
+ "normalized": false,
393
+ "rstrip": false,
394
+ "single_word": false,
395
+ "special": true
396
+ },
397
+ "156940": {
398
+ "content": "<|reserved_token_45|>",
399
+ "lstrip": false,
400
+ "normalized": false,
401
+ "rstrip": false,
402
+ "single_word": false,
403
+ "special": true
404
+ },
405
+ "156941": {
406
+ "content": "<|reserved_token_46|>",
407
+ "lstrip": false,
408
+ "normalized": false,
409
+ "rstrip": false,
410
+ "single_word": false,
411
+ "special": true
412
+ },
413
+ "156942": {
414
+ "content": "<|reserved_token_47|>",
415
+ "lstrip": false,
416
+ "normalized": false,
417
+ "rstrip": false,
418
+ "single_word": false,
419
+ "special": true
420
+ },
421
+ "156943": {
422
+ "content": "<|reserved_token_48|>",
423
+ "lstrip": false,
424
+ "normalized": false,
425
+ "rstrip": false,
426
+ "single_word": false,
427
+ "special": true
428
+ },
429
+ "156944": {
430
+ "content": "<|reserved_token_49|>",
431
+ "lstrip": false,
432
+ "normalized": false,
433
+ "rstrip": false,
434
+ "single_word": false,
435
+ "special": true
436
+ },
437
+ "156945": {
438
+ "content": "<|reserved_token_50|>",
439
+ "lstrip": false,
440
+ "normalized": false,
441
+ "rstrip": false,
442
+ "single_word": false,
443
+ "special": true
444
+ },
445
+ "156946": {
446
+ "content": "<|reserved_token_51|>",
447
+ "lstrip": false,
448
+ "normalized": false,
449
+ "rstrip": false,
450
+ "single_word": false,
451
+ "special": true
452
+ },
453
+ "156947": {
454
+ "content": "<|reserved_token_52|>",
455
+ "lstrip": false,
456
+ "normalized": false,
457
+ "rstrip": false,
458
+ "single_word": false,
459
+ "special": true
460
+ },
461
+ "156948": {
462
+ "content": "<|reserved_token_53|>",
463
+ "lstrip": false,
464
+ "normalized": false,
465
+ "rstrip": false,
466
+ "single_word": false,
467
+ "special": true
468
+ },
469
+ "156949": {
470
+ "content": "<|reserved_token_54|>",
471
+ "lstrip": false,
472
+ "normalized": false,
473
+ "rstrip": false,
474
+ "single_word": false,
475
+ "special": true
476
+ },
477
+ "156950": {
478
+ "content": "<|reserved_token_55|>",
479
+ "lstrip": false,
480
+ "normalized": false,
481
+ "rstrip": false,
482
+ "single_word": false,
483
+ "special": true
484
+ },
485
+ "156951": {
486
+ "content": "<|reserved_token_56|>",
487
+ "lstrip": false,
488
+ "normalized": false,
489
+ "rstrip": false,
490
+ "single_word": false,
491
+ "special": true
492
+ },
493
+ "156952": {
494
+ "content": "<|reserved_token_57|>",
495
+ "lstrip": false,
496
+ "normalized": false,
497
+ "rstrip": false,
498
+ "single_word": false,
499
+ "special": true
500
+ },
501
+ "156953": {
502
+ "content": "<|reserved_token_58|>",
503
+ "lstrip": false,
504
+ "normalized": false,
505
+ "rstrip": false,
506
+ "single_word": false,
507
+ "special": true
508
+ },
509
+ "156954": {
510
+ "content": "<|reserved_token_59|>",
511
+ "lstrip": false,
512
+ "normalized": false,
513
+ "rstrip": false,
514
+ "single_word": false,
515
+ "special": true
516
+ },
517
+ "156955": {
518
+ "content": "<|reserved_token_60|>",
519
+ "lstrip": false,
520
+ "normalized": false,
521
+ "rstrip": false,
522
+ "single_word": false,
523
+ "special": true
524
+ },
525
+ "156956": {
526
+ "content": "<|reserved_token_61|>",
527
+ "lstrip": false,
528
+ "normalized": false,
529
+ "rstrip": false,
530
+ "single_word": false,
531
+ "special": true
532
+ },
533
+ "156957": {
534
+ "content": "<|reserved_token_62|>",
535
+ "lstrip": false,
536
+ "normalized": false,
537
+ "rstrip": false,
538
+ "single_word": false,
539
+ "special": true
540
+ },
541
+ "156958": {
542
+ "content": "<|reserved_token_63|>",
543
+ "lstrip": false,
544
+ "normalized": false,
545
+ "rstrip": false,
546
+ "single_word": false,
547
+ "special": true
548
+ },
549
+ "156959": {
550
+ "content": "<|reserved_token_64|>",
551
+ "lstrip": false,
552
+ "normalized": false,
553
+ "rstrip": false,
554
+ "single_word": false,
555
+ "special": true
556
+ },
557
+ "156960": {
558
+ "content": "<|reserved_token_65|>",
559
+ "lstrip": false,
560
+ "normalized": false,
561
+ "rstrip": false,
562
+ "single_word": false,
563
+ "special": true
564
+ },
565
+ "156961": {
566
+ "content": "<|reserved_token_66|>",
567
+ "lstrip": false,
568
+ "normalized": false,
569
+ "rstrip": false,
570
+ "single_word": false,
571
+ "special": true
572
+ },
573
+ "156962": {
574
+ "content": "<|reserved_token_67|>",
575
+ "lstrip": false,
576
+ "normalized": false,
577
+ "rstrip": false,
578
+ "single_word": false,
579
+ "special": true
580
+ },
581
+ "156963": {
582
+ "content": "<|reserved_token_68|>",
583
+ "lstrip": false,
584
+ "normalized": false,
585
+ "rstrip": false,
586
+ "single_word": false,
587
+ "special": true
588
+ },
589
+ "156964": {
590
+ "content": "<|reserved_token_69|>",
591
+ "lstrip": false,
592
+ "normalized": false,
593
+ "rstrip": false,
594
+ "single_word": false,
595
+ "special": true
596
+ },
597
+ "156965": {
598
+ "content": "<|reserved_token_70|>",
599
+ "lstrip": false,
600
+ "normalized": false,
601
+ "rstrip": false,
602
+ "single_word": false,
603
+ "special": true
604
+ },
605
+ "156966": {
606
+ "content": "<|reserved_token_71|>",
607
+ "lstrip": false,
608
+ "normalized": false,
609
+ "rstrip": false,
610
+ "single_word": false,
611
+ "special": true
612
+ },
613
+ "156967": {
614
+ "content": "<|reserved_token_72|>",
615
+ "lstrip": false,
616
+ "normalized": false,
617
+ "rstrip": false,
618
+ "single_word": false,
619
+ "special": true
620
+ },
621
+ "156968": {
622
+ "content": "<|reserved_token_73|>",
623
+ "lstrip": false,
624
+ "normalized": false,
625
+ "rstrip": false,
626
+ "single_word": false,
627
+ "special": true
628
+ },
629
+ "156969": {
630
+ "content": "<|reserved_token_74|>",
631
+ "lstrip": false,
632
+ "normalized": false,
633
+ "rstrip": false,
634
+ "single_word": false,
635
+ "special": true
636
+ },
637
+ "156970": {
638
+ "content": "<|reserved_token_75|>",
639
+ "lstrip": false,
640
+ "normalized": false,
641
+ "rstrip": false,
642
+ "single_word": false,
643
+ "special": true
644
+ },
645
+ "156971": {
646
+ "content": "<|reserved_token_76|>",
647
+ "lstrip": false,
648
+ "normalized": false,
649
+ "rstrip": false,
650
+ "single_word": false,
651
+ "special": true
652
+ },
653
+ "156972": {
654
+ "content": "<|reserved_token_77|>",
655
+ "lstrip": false,
656
+ "normalized": false,
657
+ "rstrip": false,
658
+ "single_word": false,
659
+ "special": true
660
+ },
661
+ "156973": {
662
+ "content": "<|reserved_token_78|>",
663
+ "lstrip": false,
664
+ "normalized": false,
665
+ "rstrip": false,
666
+ "single_word": false,
667
+ "special": true
668
+ },
669
+ "156974": {
670
+ "content": "<|reserved_token_79|>",
671
+ "lstrip": false,
672
+ "normalized": false,
673
+ "rstrip": false,
674
+ "single_word": false,
675
+ "special": true
676
+ },
677
+ "156975": {
678
+ "content": "<|reserved_token_80|>",
679
+ "lstrip": false,
680
+ "normalized": false,
681
+ "rstrip": false,
682
+ "single_word": false,
683
+ "special": true
684
+ },
685
+ "156976": {
686
+ "content": "<|reserved_token_81|>",
687
+ "lstrip": false,
688
+ "normalized": false,
689
+ "rstrip": false,
690
+ "single_word": false,
691
+ "special": true
692
+ },
693
+ "156977": {
694
+ "content": "<|reserved_token_82|>",
695
+ "lstrip": false,
696
+ "normalized": false,
697
+ "rstrip": false,
698
+ "single_word": false,
699
+ "special": true
700
+ },
701
+ "156978": {
702
+ "content": "<|reserved_token_83|>",
703
+ "lstrip": false,
704
+ "normalized": false,
705
+ "rstrip": false,
706
+ "single_word": false,
707
+ "special": true
708
+ },
709
+ "156979": {
710
+ "content": "<|reserved_token_84|>",
711
+ "lstrip": false,
712
+ "normalized": false,
713
+ "rstrip": false,
714
+ "single_word": false,
715
+ "special": true
716
+ },
717
+ "156980": {
718
+ "content": "<|reserved_token_85|>",
719
+ "lstrip": false,
720
+ "normalized": false,
721
+ "rstrip": false,
722
+ "single_word": false,
723
+ "special": true
724
+ },
725
+ "156981": {
726
+ "content": "<|reserved_token_86|>",
727
+ "lstrip": false,
728
+ "normalized": false,
729
+ "rstrip": false,
730
+ "single_word": false,
731
+ "special": true
732
+ },
733
+ "156982": {
734
+ "content": "<|reserved_token_87|>",
735
+ "lstrip": false,
736
+ "normalized": false,
737
+ "rstrip": false,
738
+ "single_word": false,
739
+ "special": true
740
+ },
741
+ "156983": {
742
+ "content": "<|reserved_token_88|>",
743
+ "lstrip": false,
744
+ "normalized": false,
745
+ "rstrip": false,
746
+ "single_word": false,
747
+ "special": true
748
+ },
749
+ "156984": {
750
+ "content": "<|reserved_token_89|>",
751
+ "lstrip": false,
752
+ "normalized": false,
753
+ "rstrip": false,
754
+ "single_word": false,
755
+ "special": true
756
+ },
757
+ "156985": {
758
+ "content": "<|reserved_token_90|>",
759
+ "lstrip": false,
760
+ "normalized": false,
761
+ "rstrip": false,
762
+ "single_word": false,
763
+ "special": true
764
+ },
765
+ "156986": {
766
+ "content": "<|reserved_token_91|>",
767
+ "lstrip": false,
768
+ "normalized": false,
769
+ "rstrip": false,
770
+ "single_word": false,
771
+ "special": true
772
+ },
773
+ "156987": {
774
+ "content": "<|reserved_token_92|>",
775
+ "lstrip": false,
776
+ "normalized": false,
777
+ "rstrip": false,
778
+ "single_word": false,
779
+ "special": true
780
+ },
781
+ "156988": {
782
+ "content": "<|reserved_token_93|>",
783
+ "lstrip": false,
784
+ "normalized": false,
785
+ "rstrip": false,
786
+ "single_word": false,
787
+ "special": true
788
+ },
789
+ "156989": {
790
+ "content": "<|reserved_token_94|>",
791
+ "lstrip": false,
792
+ "normalized": false,
793
+ "rstrip": false,
794
+ "single_word": false,
795
+ "special": true
796
+ },
797
+ "156990": {
798
+ "content": "<|reserved_token_95|>",
799
+ "lstrip": false,
800
+ "normalized": false,
801
+ "rstrip": false,
802
+ "single_word": false,
803
+ "special": true
804
+ },
805
+ "156991": {
806
+ "content": "<|reserved_token_96|>",
807
+ "lstrip": false,
808
+ "normalized": false,
809
+ "rstrip": false,
810
+ "single_word": false,
811
+ "special": true
812
+ },
813
+ "156992": {
814
+ "content": "<|reserved_token_97|>",
815
+ "lstrip": false,
816
+ "normalized": false,
817
+ "rstrip": false,
818
+ "single_word": false,
819
+ "special": true
820
+ },
821
+ "156993": {
822
+ "content": "<|reserved_token_98|>",
823
+ "lstrip": false,
824
+ "normalized": false,
825
+ "rstrip": false,
826
+ "single_word": false,
827
+ "special": true
828
+ },
829
+ "156994": {
830
+ "content": "<|reserved_token_99|>",
831
+ "lstrip": false,
832
+ "normalized": false,
833
+ "rstrip": false,
834
+ "single_word": false,
835
+ "special": true
836
+ },
837
+ "156995": {
838
+ "content": "<|reserved_token_100|>",
839
+ "lstrip": false,
840
+ "normalized": false,
841
+ "rstrip": false,
842
+ "single_word": false,
843
+ "special": true
844
+ },
845
+ "156996": {
846
+ "content": "<|reserved_token_101|>",
847
+ "lstrip": false,
848
+ "normalized": false,
849
+ "rstrip": false,
850
+ "single_word": false,
851
+ "special": true
852
+ },
853
+ "156997": {
854
+ "content": "<|reserved_token_102|>",
855
+ "lstrip": false,
856
+ "normalized": false,
857
+ "rstrip": false,
858
+ "single_word": false,
859
+ "special": true
860
+ },
861
+ "156998": {
862
+ "content": "<|reserved_token_103|>",
863
+ "lstrip": false,
864
+ "normalized": false,
865
+ "rstrip": false,
866
+ "single_word": false,
867
+ "special": true
868
+ },
869
+ "156999": {
870
+ "content": "<|reserved_token_104|>",
871
+ "lstrip": false,
872
+ "normalized": false,
873
+ "rstrip": false,
874
+ "single_word": false,
875
+ "special": true
876
+ },
877
+ "157000": {
878
+ "content": "<|reserved_token_105|>",
879
+ "lstrip": false,
880
+ "normalized": false,
881
+ "rstrip": false,
882
+ "single_word": false,
883
+ "special": true
884
+ },
885
+ "157001": {
886
+ "content": "<|reserved_token_106|>",
887
+ "lstrip": false,
888
+ "normalized": false,
889
+ "rstrip": false,
890
+ "single_word": false,
891
+ "special": true
892
+ },
893
+ "157002": {
894
+ "content": "<|reserved_token_107|>",
895
+ "lstrip": false,
896
+ "normalized": false,
897
+ "rstrip": false,
898
+ "single_word": false,
899
+ "special": true
900
+ },
901
+ "157003": {
902
+ "content": "<|reserved_token_108|>",
903
+ "lstrip": false,
904
+ "normalized": false,
905
+ "rstrip": false,
906
+ "single_word": false,
907
+ "special": true
908
+ },
909
+ "157004": {
910
+ "content": "<|reserved_token_109|>",
911
+ "lstrip": false,
912
+ "normalized": false,
913
+ "rstrip": false,
914
+ "single_word": false,
915
+ "special": true
916
+ },
917
+ "157005": {
918
+ "content": "<|reserved_token_110|>",
919
+ "lstrip": false,
920
+ "normalized": false,
921
+ "rstrip": false,
922
+ "single_word": false,
923
+ "special": true
924
+ },
925
+ "157006": {
926
+ "content": "<|reserved_token_111|>",
927
+ "lstrip": false,
928
+ "normalized": false,
929
+ "rstrip": false,
930
+ "single_word": false,
931
+ "special": true
932
+ },
933
+ "157007": {
934
+ "content": "<|reserved_token_112|>",
935
+ "lstrip": false,
936
+ "normalized": false,
937
+ "rstrip": false,
938
+ "single_word": false,
939
+ "special": true
940
+ },
941
+ "157008": {
942
+ "content": "<|reserved_token_113|>",
943
+ "lstrip": false,
944
+ "normalized": false,
945
+ "rstrip": false,
946
+ "single_word": false,
947
+ "special": true
948
+ },
949
+ "157009": {
950
+ "content": "<|reserved_token_114|>",
951
+ "lstrip": false,
952
+ "normalized": false,
953
+ "rstrip": false,
954
+ "single_word": false,
955
+ "special": true
956
+ },
957
+ "157010": {
958
+ "content": "<|reserved_token_115|>",
959
+ "lstrip": false,
960
+ "normalized": false,
961
+ "rstrip": false,
962
+ "single_word": false,
963
+ "special": true
964
+ },
965
+ "157011": {
966
+ "content": "<|reserved_token_116|>",
967
+ "lstrip": false,
968
+ "normalized": false,
969
+ "rstrip": false,
970
+ "single_word": false,
971
+ "special": true
972
+ },
973
+ "157012": {
974
+ "content": "<|reserved_token_117|>",
975
+ "lstrip": false,
976
+ "normalized": false,
977
+ "rstrip": false,
978
+ "single_word": false,
979
+ "special": true
980
+ },
981
+ "157013": {
982
+ "content": "<|reserved_token_118|>",
983
+ "lstrip": false,
984
+ "normalized": false,
985
+ "rstrip": false,
986
+ "single_word": false,
987
+ "special": true
988
+ },
989
+ "157014": {
990
+ "content": "<|reserved_token_119|>",
991
+ "lstrip": false,
992
+ "normalized": false,
993
+ "rstrip": false,
994
+ "single_word": false,
995
+ "special": true
996
+ },
997
+ "157015": {
998
+ "content": "<|reserved_token_120|>",
999
+ "lstrip": false,
1000
+ "normalized": false,
1001
+ "rstrip": false,
1002
+ "single_word": false,
1003
+ "special": true
1004
+ },
1005
+ "157016": {
1006
+ "content": "<|reserved_token_121|>",
1007
+ "lstrip": false,
1008
+ "normalized": false,
1009
+ "rstrip": false,
1010
+ "single_word": false,
1011
+ "special": true
1012
+ },
1013
+ "157017": {
1014
+ "content": "<|reserved_token_122|>",
1015
+ "lstrip": false,
1016
+ "normalized": false,
1017
+ "rstrip": false,
1018
+ "single_word": false,
1019
+ "special": true
1020
+ },
1021
+ "157018": {
1022
+ "content": "<|reserved_token_123|>",
1023
+ "lstrip": false,
1024
+ "normalized": false,
1025
+ "rstrip": false,
1026
+ "single_word": false,
1027
+ "special": true
1028
+ },
1029
+ "157019": {
1030
+ "content": "<|reserved_token_124|>",
1031
+ "lstrip": false,
1032
+ "normalized": false,
1033
+ "rstrip": false,
1034
+ "single_word": false,
1035
+ "special": true
1036
+ },
1037
+ "157020": {
1038
+ "content": "<|reserved_token_125|>",
1039
+ "lstrip": false,
1040
+ "normalized": false,
1041
+ "rstrip": false,
1042
+ "single_word": false,
1043
+ "special": true
1044
+ },
1045
+ "157021": {
1046
+ "content": "<|reserved_token_126|>",
1047
+ "lstrip": false,
1048
+ "normalized": false,
1049
+ "rstrip": false,
1050
+ "single_word": false,
1051
+ "special": true
1052
+ },
1053
+ "157022": {
1054
+ "content": "<|reserved_token_127|>",
1055
+ "lstrip": false,
1056
+ "normalized": false,
1057
+ "rstrip": false,
1058
+ "single_word": false,
1059
+ "special": true
1060
+ },
1061
+ "157023": {
1062
+ "content": "<|reserved_token_128|>",
1063
+ "lstrip": false,
1064
+ "normalized": false,
1065
+ "rstrip": false,
1066
+ "single_word": false,
1067
+ "special": true
1068
+ },
1069
+ "157024": {
1070
+ "content": "<|reserved_token_129|>",
1071
+ "lstrip": false,
1072
+ "normalized": false,
1073
+ "rstrip": false,
1074
+ "single_word": false,
1075
+ "special": true
1076
+ },
1077
+ "157025": {
1078
+ "content": "<|reserved_token_130|>",
1079
+ "lstrip": false,
1080
+ "normalized": false,
1081
+ "rstrip": false,
1082
+ "single_word": false,
1083
+ "special": true
1084
+ },
1085
+ "157026": {
1086
+ "content": "<|reserved_token_131|>",
1087
+ "lstrip": false,
1088
+ "normalized": false,
1089
+ "rstrip": false,
1090
+ "single_word": false,
1091
+ "special": true
1092
+ },
1093
+ "157027": {
1094
+ "content": "<|reserved_token_132|>",
1095
+ "lstrip": false,
1096
+ "normalized": false,
1097
+ "rstrip": false,
1098
+ "single_word": false,
1099
+ "special": true
1100
+ },
1101
+ "157028": {
1102
+ "content": "<|reserved_token_133|>",
1103
+ "lstrip": false,
1104
+ "normalized": false,
1105
+ "rstrip": false,
1106
+ "single_word": false,
1107
+ "special": true
1108
+ },
1109
+ "157029": {
1110
+ "content": "<|reserved_token_134|>",
1111
+ "lstrip": false,
1112
+ "normalized": false,
1113
+ "rstrip": false,
1114
+ "single_word": false,
1115
+ "special": true
1116
+ },
1117
+ "157030": {
1118
+ "content": "<|reserved_token_135|>",
1119
+ "lstrip": false,
1120
+ "normalized": false,
1121
+ "rstrip": false,
1122
+ "single_word": false,
1123
+ "special": true
1124
+ },
1125
+ "157031": {
1126
+ "content": "<|reserved_token_136|>",
1127
+ "lstrip": false,
1128
+ "normalized": false,
1129
+ "rstrip": false,
1130
+ "single_word": false,
1131
+ "special": true
1132
+ },
1133
+ "157032": {
1134
+ "content": "<|reserved_token_137|>",
1135
+ "lstrip": false,
1136
+ "normalized": false,
1137
+ "rstrip": false,
1138
+ "single_word": false,
1139
+ "special": true
1140
+ },
1141
+ "157033": {
1142
+ "content": "<|reserved_token_138|>",
1143
+ "lstrip": false,
1144
+ "normalized": false,
1145
+ "rstrip": false,
1146
+ "single_word": false,
1147
+ "special": true
1148
+ },
1149
+ "157034": {
1150
+ "content": "<|reserved_token_139|>",
1151
+ "lstrip": false,
1152
+ "normalized": false,
1153
+ "rstrip": false,
1154
+ "single_word": false,
1155
+ "special": true
1156
+ },
1157
+ "157035": {
1158
+ "content": "<|reserved_token_140|>",
1159
+ "lstrip": false,
1160
+ "normalized": false,
1161
+ "rstrip": false,
1162
+ "single_word": false,
1163
+ "special": true
1164
+ },
1165
+ "157036": {
1166
+ "content": "<|reserved_token_141|>",
1167
+ "lstrip": false,
1168
+ "normalized": false,
1169
+ "rstrip": false,
1170
+ "single_word": false,
1171
+ "special": true
1172
+ },
1173
+ "157037": {
1174
+ "content": "<|reserved_token_142|>",
1175
+ "lstrip": false,
1176
+ "normalized": false,
1177
+ "rstrip": false,
1178
+ "single_word": false,
1179
+ "special": true
1180
+ },
1181
+ "157038": {
1182
+ "content": "<|reserved_token_143|>",
1183
+ "lstrip": false,
1184
+ "normalized": false,
1185
+ "rstrip": false,
1186
+ "single_word": false,
1187
+ "special": true
1188
+ },
1189
+ "157039": {
1190
+ "content": "<|reserved_token_144|>",
1191
+ "lstrip": false,
1192
+ "normalized": false,
1193
+ "rstrip": false,
1194
+ "single_word": false,
1195
+ "special": true
1196
+ },
1197
+ "157040": {
1198
+ "content": "<|reserved_token_145|>",
1199
+ "lstrip": false,
1200
+ "normalized": false,
1201
+ "rstrip": false,
1202
+ "single_word": false,
1203
+ "special": true
1204
+ },
1205
+ "157041": {
1206
+ "content": "<|reserved_token_146|>",
1207
+ "lstrip": false,
1208
+ "normalized": false,
1209
+ "rstrip": false,
1210
+ "single_word": false,
1211
+ "special": true
1212
+ },
1213
+ "157042": {
1214
+ "content": "<|reserved_token_147|>",
1215
+ "lstrip": false,
1216
+ "normalized": false,
1217
+ "rstrip": false,
1218
+ "single_word": false,
1219
+ "special": true
1220
+ },
1221
+ "157043": {
1222
+ "content": "<|reserved_token_148|>",
1223
+ "lstrip": false,
1224
+ "normalized": false,
1225
+ "rstrip": false,
1226
+ "single_word": false,
1227
+ "special": true
1228
+ },
1229
+ "157044": {
1230
+ "content": "<|reserved_token_149|>",
1231
+ "lstrip": false,
1232
+ "normalized": false,
1233
+ "rstrip": false,
1234
+ "single_word": false,
1235
+ "special": true
1236
+ },
1237
+ "157045": {
1238
+ "content": "<|reserved_token_150|>",
1239
+ "lstrip": false,
1240
+ "normalized": false,
1241
+ "rstrip": false,
1242
+ "single_word": false,
1243
+ "special": true
1244
+ },
1245
+ "157046": {
1246
+ "content": "<|reserved_token_151|>",
1247
+ "lstrip": false,
1248
+ "normalized": false,
1249
+ "rstrip": false,
1250
+ "single_word": false,
1251
+ "special": true
1252
+ },
1253
+ "157047": {
1254
+ "content": "<|reserved_token_152|>",
1255
+ "lstrip": false,
1256
+ "normalized": false,
1257
+ "rstrip": false,
1258
+ "single_word": false,
1259
+ "special": true
1260
+ },
1261
+ "157048": {
1262
+ "content": "<|reserved_token_153|>",
1263
+ "lstrip": false,
1264
+ "normalized": false,
1265
+ "rstrip": false,
1266
+ "single_word": false,
1267
+ "special": true
1268
+ },
1269
+ "157049": {
1270
+ "content": "<|reserved_token_154|>",
1271
+ "lstrip": false,
1272
+ "normalized": false,
1273
+ "rstrip": false,
1274
+ "single_word": false,
1275
+ "special": true
1276
+ },
1277
+ "157050": {
1278
+ "content": "<|reserved_token_155|>",
1279
+ "lstrip": false,
1280
+ "normalized": false,
1281
+ "rstrip": false,
1282
+ "single_word": false,
1283
+ "special": true
1284
+ },
1285
+ "157051": {
1286
+ "content": "<|reserved_token_156|>",
1287
+ "lstrip": false,
1288
+ "normalized": false,
1289
+ "rstrip": false,
1290
+ "single_word": false,
1291
+ "special": true
1292
+ },
1293
+ "157052": {
1294
+ "content": "<|reserved_token_157|>",
1295
+ "lstrip": false,
1296
+ "normalized": false,
1297
+ "rstrip": false,
1298
+ "single_word": false,
1299
+ "special": true
1300
+ },
1301
+ "157053": {
1302
+ "content": "<|reserved_token_158|>",
1303
+ "lstrip": false,
1304
+ "normalized": false,
1305
+ "rstrip": false,
1306
+ "single_word": false,
1307
+ "special": true
1308
+ },
1309
+ "157054": {
1310
+ "content": "<|reserved_token_159|>",
1311
+ "lstrip": false,
1312
+ "normalized": false,
1313
+ "rstrip": false,
1314
+ "single_word": false,
1315
+ "special": true
1316
+ },
1317
+ "157055": {
1318
+ "content": "<|reserved_token_160|>",
1319
+ "lstrip": false,
1320
+ "normalized": false,
1321
+ "rstrip": false,
1322
+ "single_word": false,
1323
+ "special": true
1324
+ },
1325
+ "157056": {
1326
+ "content": "<|reserved_token_161|>",
1327
+ "lstrip": false,
1328
+ "normalized": false,
1329
+ "rstrip": false,
1330
+ "single_word": false,
1331
+ "special": true
1332
+ },
1333
+ "157057": {
1334
+ "content": "<|reserved_token_162|>",
1335
+ "lstrip": false,
1336
+ "normalized": false,
1337
+ "rstrip": false,
1338
+ "single_word": false,
1339
+ "special": true
1340
+ },
1341
+ "157058": {
1342
+ "content": "<|reserved_token_163|>",
1343
+ "lstrip": false,
1344
+ "normalized": false,
1345
+ "rstrip": false,
1346
+ "single_word": false,
1347
+ "special": true
1348
+ },
1349
+ "157059": {
1350
+ "content": "<|reserved_token_164|>",
1351
+ "lstrip": false,
1352
+ "normalized": false,
1353
+ "rstrip": false,
1354
+ "single_word": false,
1355
+ "special": true
1356
+ },
1357
+ "157060": {
1358
+ "content": "<|reserved_token_165|>",
1359
+ "lstrip": false,
1360
+ "normalized": false,
1361
+ "rstrip": false,
1362
+ "single_word": false,
1363
+ "special": true
1364
+ },
1365
+ "157061": {
1366
+ "content": "<|reserved_token_166|>",
1367
+ "lstrip": false,
1368
+ "normalized": false,
1369
+ "rstrip": false,
1370
+ "single_word": false,
1371
+ "special": true
1372
+ },
1373
+ "157062": {
1374
+ "content": "<|reserved_token_167|>",
1375
+ "lstrip": false,
1376
+ "normalized": false,
1377
+ "rstrip": false,
1378
+ "single_word": false,
1379
+ "special": true
1380
+ },
1381
+ "157063": {
1382
+ "content": "<|reserved_token_168|>",
1383
+ "lstrip": false,
1384
+ "normalized": false,
1385
+ "rstrip": false,
1386
+ "single_word": false,
1387
+ "special": true
1388
+ },
1389
+ "157064": {
1390
+ "content": "<|reserved_token_169|>",
1391
+ "lstrip": false,
1392
+ "normalized": false,
1393
+ "rstrip": false,
1394
+ "single_word": false,
1395
+ "special": true
1396
+ },
1397
+ "157065": {
1398
+ "content": "<|reserved_token_170|>",
1399
+ "lstrip": false,
1400
+ "normalized": false,
1401
+ "rstrip": false,
1402
+ "single_word": false,
1403
+ "special": true
1404
+ },
1405
+ "157066": {
1406
+ "content": "<|reserved_token_171|>",
1407
+ "lstrip": false,
1408
+ "normalized": false,
1409
+ "rstrip": false,
1410
+ "single_word": false,
1411
+ "special": true
1412
+ },
1413
+ "157067": {
1414
+ "content": "<|reserved_token_172|>",
1415
+ "lstrip": false,
1416
+ "normalized": false,
1417
+ "rstrip": false,
1418
+ "single_word": false,
1419
+ "special": true
1420
+ },
1421
+ "157068": {
1422
+ "content": "<|reserved_token_173|>",
1423
+ "lstrip": false,
1424
+ "normalized": false,
1425
+ "rstrip": false,
1426
+ "single_word": false,
1427
+ "special": true
1428
+ },
1429
+ "157069": {
1430
+ "content": "<|reserved_token_174|>",
1431
+ "lstrip": false,
1432
+ "normalized": false,
1433
+ "rstrip": false,
1434
+ "single_word": false,
1435
+ "special": true
1436
+ },
1437
+ "157070": {
1438
+ "content": "<|reserved_token_175|>",
1439
+ "lstrip": false,
1440
+ "normalized": false,
1441
+ "rstrip": false,
1442
+ "single_word": false,
1443
+ "special": true
1444
+ },
1445
+ "157071": {
1446
+ "content": "<|reserved_token_176|>",
1447
+ "lstrip": false,
1448
+ "normalized": false,
1449
+ "rstrip": false,
1450
+ "single_word": false,
1451
+ "special": true
1452
+ },
1453
+ "157072": {
1454
+ "content": "<|reserved_token_177|>",
1455
+ "lstrip": false,
1456
+ "normalized": false,
1457
+ "rstrip": false,
1458
+ "single_word": false,
1459
+ "special": true
1460
+ },
1461
+ "157073": {
1462
+ "content": "<|reserved_token_178|>",
1463
+ "lstrip": false,
1464
+ "normalized": false,
1465
+ "rstrip": false,
1466
+ "single_word": false,
1467
+ "special": true
1468
+ },
1469
+ "157074": {
1470
+ "content": "<|reserved_token_179|>",
1471
+ "lstrip": false,
1472
+ "normalized": false,
1473
+ "rstrip": false,
1474
+ "single_word": false,
1475
+ "special": true
1476
+ },
1477
+ "157075": {
1478
+ "content": "<|reserved_token_180|>",
1479
+ "lstrip": false,
1480
+ "normalized": false,
1481
+ "rstrip": false,
1482
+ "single_word": false,
1483
+ "special": true
1484
+ },
1485
+ "157076": {
1486
+ "content": "<|reserved_token_181|>",
1487
+ "lstrip": false,
1488
+ "normalized": false,
1489
+ "rstrip": false,
1490
+ "single_word": false,
1491
+ "special": true
1492
+ },
1493
+ "157077": {
1494
+ "content": "<|reserved_token_182|>",
1495
+ "lstrip": false,
1496
+ "normalized": false,
1497
+ "rstrip": false,
1498
+ "single_word": false,
1499
+ "special": true
1500
+ },
1501
+ "157078": {
1502
+ "content": "<|reserved_token_183|>",
1503
+ "lstrip": false,
1504
+ "normalized": false,
1505
+ "rstrip": false,
1506
+ "single_word": false,
1507
+ "special": true
1508
+ },
1509
+ "157079": {
1510
+ "content": "<|reserved_token_184|>",
1511
+ "lstrip": false,
1512
+ "normalized": false,
1513
+ "rstrip": false,
1514
+ "single_word": false,
1515
+ "special": true
1516
+ },
1517
+ "157080": {
1518
+ "content": "<|reserved_token_185|>",
1519
+ "lstrip": false,
1520
+ "normalized": false,
1521
+ "rstrip": false,
1522
+ "single_word": false,
1523
+ "special": true
1524
+ },
1525
+ "157081": {
1526
+ "content": "<|reserved_token_186|>",
1527
+ "lstrip": false,
1528
+ "normalized": false,
1529
+ "rstrip": false,
1530
+ "single_word": false,
1531
+ "special": true
1532
+ },
1533
+ "157082": {
1534
+ "content": "<|reserved_token_187|>",
1535
+ "lstrip": false,
1536
+ "normalized": false,
1537
+ "rstrip": false,
1538
+ "single_word": false,
1539
+ "special": true
1540
+ },
1541
+ "157083": {
1542
+ "content": "<|reserved_token_188|>",
1543
+ "lstrip": false,
1544
+ "normalized": false,
1545
+ "rstrip": false,
1546
+ "single_word": false,
1547
+ "special": true
1548
+ },
1549
+ "157084": {
1550
+ "content": "<|reserved_token_189|>",
1551
+ "lstrip": false,
1552
+ "normalized": false,
1553
+ "rstrip": false,
1554
+ "single_word": false,
1555
+ "special": true
1556
+ },
1557
+ "157085": {
1558
+ "content": "<|reserved_token_190|>",
1559
+ "lstrip": false,
1560
+ "normalized": false,
1561
+ "rstrip": false,
1562
+ "single_word": false,
1563
+ "special": true
1564
+ },
1565
+ "157086": {
1566
+ "content": "<|reserved_token_191|>",
1567
+ "lstrip": false,
1568
+ "normalized": false,
1569
+ "rstrip": false,
1570
+ "single_word": false,
1571
+ "special": true
1572
+ },
1573
+ "157087": {
1574
+ "content": "<|reserved_token_192|>",
1575
+ "lstrip": false,
1576
+ "normalized": false,
1577
+ "rstrip": false,
1578
+ "single_word": false,
1579
+ "special": true
1580
+ },
1581
+ "157088": {
1582
+ "content": "<|reserved_token_193|>",
1583
+ "lstrip": false,
1584
+ "normalized": false,
1585
+ "rstrip": false,
1586
+ "single_word": false,
1587
+ "special": true
1588
+ },
1589
+ "157089": {
1590
+ "content": "<|reserved_token_194|>",
1591
+ "lstrip": false,
1592
+ "normalized": false,
1593
+ "rstrip": false,
1594
+ "single_word": false,
1595
+ "special": true
1596
+ },
1597
+ "157090": {
1598
+ "content": "<|reserved_token_195|>",
1599
+ "lstrip": false,
1600
+ "normalized": false,
1601
+ "rstrip": false,
1602
+ "single_word": false,
1603
+ "special": true
1604
+ },
1605
+ "157091": {
1606
+ "content": "<|reserved_token_196|>",
1607
+ "lstrip": false,
1608
+ "normalized": false,
1609
+ "rstrip": false,
1610
+ "single_word": false,
1611
+ "special": true
1612
+ },
1613
+ "157092": {
1614
+ "content": "<|reserved_token_197|>",
1615
+ "lstrip": false,
1616
+ "normalized": false,
1617
+ "rstrip": false,
1618
+ "single_word": false,
1619
+ "special": true
1620
+ },
1621
+ "157093": {
1622
+ "content": "<|reserved_token_198|>",
1623
+ "lstrip": false,
1624
+ "normalized": false,
1625
+ "rstrip": false,
1626
+ "single_word": false,
1627
+ "special": true
1628
+ },
1629
+ "157094": {
1630
+ "content": "<|reserved_token_199|>",
1631
+ "lstrip": false,
1632
+ "normalized": false,
1633
+ "rstrip": false,
1634
+ "single_word": false,
1635
+ "special": true
1636
+ },
1637
+ "157095": {
1638
+ "content": "<|reserved_token_200|>",
1639
+ "lstrip": false,
1640
+ "normalized": false,
1641
+ "rstrip": false,
1642
+ "single_word": false,
1643
+ "special": true
1644
+ },
1645
+ "157096": {
1646
+ "content": "<|reserved_token_201|>",
1647
+ "lstrip": false,
1648
+ "normalized": false,
1649
+ "rstrip": false,
1650
+ "single_word": false,
1651
+ "special": true
1652
+ },
1653
+ "157097": {
1654
+ "content": "<|reserved_token_202|>",
1655
+ "lstrip": false,
1656
+ "normalized": false,
1657
+ "rstrip": false,
1658
+ "single_word": false,
1659
+ "special": true
1660
+ },
1661
+ "157098": {
1662
+ "content": "<|reserved_token_203|>",
1663
+ "lstrip": false,
1664
+ "normalized": false,
1665
+ "rstrip": false,
1666
+ "single_word": false,
1667
+ "special": true
1668
+ },
1669
+ "157099": {
1670
+ "content": "<|reserved_token_204|>",
1671
+ "lstrip": false,
1672
+ "normalized": false,
1673
+ "rstrip": false,
1674
+ "single_word": false,
1675
+ "special": true
1676
+ },
1677
+ "157100": {
1678
+ "content": "<|reserved_token_205|>",
1679
+ "lstrip": false,
1680
+ "normalized": false,
1681
+ "rstrip": false,
1682
+ "single_word": false,
1683
+ "special": true
1684
+ },
1685
+ "157101": {
1686
+ "content": "<|reserved_token_206|>",
1687
+ "lstrip": false,
1688
+ "normalized": false,
1689
+ "rstrip": false,
1690
+ "single_word": false,
1691
+ "special": true
1692
+ },
1693
+ "157102": {
1694
+ "content": "<|reserved_token_207|>",
1695
+ "lstrip": false,
1696
+ "normalized": false,
1697
+ "rstrip": false,
1698
+ "single_word": false,
1699
+ "special": true
1700
+ },
1701
+ "157103": {
1702
+ "content": "<|reserved_token_208|>",
1703
+ "lstrip": false,
1704
+ "normalized": false,
1705
+ "rstrip": false,
1706
+ "single_word": false,
1707
+ "special": true
1708
+ },
1709
+ "157104": {
1710
+ "content": "<|reserved_token_209|>",
1711
+ "lstrip": false,
1712
+ "normalized": false,
1713
+ "rstrip": false,
1714
+ "single_word": false,
1715
+ "special": true
1716
+ },
1717
+ "157105": {
1718
+ "content": "<|reserved_token_210|>",
1719
+ "lstrip": false,
1720
+ "normalized": false,
1721
+ "rstrip": false,
1722
+ "single_word": false,
1723
+ "special": true
1724
+ },
1725
+ "157106": {
1726
+ "content": "<|reserved_token_211|>",
1727
+ "lstrip": false,
1728
+ "normalized": false,
1729
+ "rstrip": false,
1730
+ "single_word": false,
1731
+ "special": true
1732
+ },
1733
+ "157107": {
1734
+ "content": "<|reserved_token_212|>",
1735
+ "lstrip": false,
1736
+ "normalized": false,
1737
+ "rstrip": false,
1738
+ "single_word": false,
1739
+ "special": true
1740
+ },
1741
+ "157108": {
1742
+ "content": "<|reserved_token_213|>",
1743
+ "lstrip": false,
1744
+ "normalized": false,
1745
+ "rstrip": false,
1746
+ "single_word": false,
1747
+ "special": true
1748
+ },
1749
+ "157109": {
1750
+ "content": "<|reserved_token_214|>",
1751
+ "lstrip": false,
1752
+ "normalized": false,
1753
+ "rstrip": false,
1754
+ "single_word": false,
1755
+ "special": true
1756
+ },
1757
+ "157110": {
1758
+ "content": "<|reserved_token_215|>",
1759
+ "lstrip": false,
1760
+ "normalized": false,
1761
+ "rstrip": false,
1762
+ "single_word": false,
1763
+ "special": true
1764
+ },
1765
+ "157111": {
1766
+ "content": "<|reserved_token_216|>",
1767
+ "lstrip": false,
1768
+ "normalized": false,
1769
+ "rstrip": false,
1770
+ "single_word": false,
1771
+ "special": true
1772
+ },
1773
+ "157112": {
1774
+ "content": "<|reserved_token_217|>",
1775
+ "lstrip": false,
1776
+ "normalized": false,
1777
+ "rstrip": false,
1778
+ "single_word": false,
1779
+ "special": true
1780
+ },
1781
+ "157113": {
1782
+ "content": "<|reserved_token_218|>",
1783
+ "lstrip": false,
1784
+ "normalized": false,
1785
+ "rstrip": false,
1786
+ "single_word": false,
1787
+ "special": true
1788
+ },
1789
+ "157114": {
1790
+ "content": "<|reserved_token_219|>",
1791
+ "lstrip": false,
1792
+ "normalized": false,
1793
+ "rstrip": false,
1794
+ "single_word": false,
1795
+ "special": true
1796
+ },
1797
+ "157115": {
1798
+ "content": "<|reserved_token_220|>",
1799
+ "lstrip": false,
1800
+ "normalized": false,
1801
+ "rstrip": false,
1802
+ "single_word": false,
1803
+ "special": true
1804
+ },
1805
+ "157116": {
1806
+ "content": "<|reserved_token_221|>",
1807
+ "lstrip": false,
1808
+ "normalized": false,
1809
+ "rstrip": false,
1810
+ "single_word": false,
1811
+ "special": true
1812
+ },
1813
+ "157117": {
1814
+ "content": "<|reserved_token_222|>",
1815
+ "lstrip": false,
1816
+ "normalized": false,
1817
+ "rstrip": false,
1818
+ "single_word": false,
1819
+ "special": true
1820
+ },
1821
+ "157118": {
1822
+ "content": "<|reserved_token_223|>",
1823
+ "lstrip": false,
1824
+ "normalized": false,
1825
+ "rstrip": false,
1826
+ "single_word": false,
1827
+ "special": true
1828
+ },
1829
+ "157119": {
1830
+ "content": "<|reserved_token_224|>",
1831
+ "lstrip": false,
1832
+ "normalized": false,
1833
+ "rstrip": false,
1834
+ "single_word": false,
1835
+ "special": true
1836
+ },
1837
+ "157120": {
1838
+ "content": "<|reserved_token_225|>",
1839
+ "lstrip": false,
1840
+ "normalized": false,
1841
+ "rstrip": false,
1842
+ "single_word": false,
1843
+ "special": true
1844
+ },
1845
+ "157121": {
1846
+ "content": "<|reserved_token_226|>",
1847
+ "lstrip": false,
1848
+ "normalized": false,
1849
+ "rstrip": false,
1850
+ "single_word": false,
1851
+ "special": true
1852
+ },
1853
+ "157122": {
1854
+ "content": "<|reserved_token_227|>",
1855
+ "lstrip": false,
1856
+ "normalized": false,
1857
+ "rstrip": false,
1858
+ "single_word": false,
1859
+ "special": true
1860
+ },
1861
+ "157123": {
1862
+ "content": "<|reserved_token_228|>",
1863
+ "lstrip": false,
1864
+ "normalized": false,
1865
+ "rstrip": false,
1866
+ "single_word": false,
1867
+ "special": true
1868
+ },
1869
+ "157124": {
1870
+ "content": "<|reserved_token_229|>",
1871
+ "lstrip": false,
1872
+ "normalized": false,
1873
+ "rstrip": false,
1874
+ "single_word": false,
1875
+ "special": true
1876
+ },
1877
+ "157125": {
1878
+ "content": "<|reserved_token_230|>",
1879
+ "lstrip": false,
1880
+ "normalized": false,
1881
+ "rstrip": false,
1882
+ "single_word": false,
1883
+ "special": true
1884
+ },
1885
+ "157126": {
1886
+ "content": "<|reserved_token_231|>",
1887
+ "lstrip": false,
1888
+ "normalized": false,
1889
+ "rstrip": false,
1890
+ "single_word": false,
1891
+ "special": true
1892
+ },
1893
+ "157127": {
1894
+ "content": "<|reserved_token_232|>",
1895
+ "lstrip": false,
1896
+ "normalized": false,
1897
+ "rstrip": false,
1898
+ "single_word": false,
1899
+ "special": true
1900
+ },
1901
+ "157128": {
1902
+ "content": "<|reserved_token_233|>",
1903
+ "lstrip": false,
1904
+ "normalized": false,
1905
+ "rstrip": false,
1906
+ "single_word": false,
1907
+ "special": true
1908
+ },
1909
+ "157129": {
1910
+ "content": "<|reserved_token_234|>",
1911
+ "lstrip": false,
1912
+ "normalized": false,
1913
+ "rstrip": false,
1914
+ "single_word": false,
1915
+ "special": true
1916
+ },
1917
+ "157130": {
1918
+ "content": "<|reserved_token_235|>",
1919
+ "lstrip": false,
1920
+ "normalized": false,
1921
+ "rstrip": false,
1922
+ "single_word": false,
1923
+ "special": true
1924
+ },
1925
+ "157131": {
1926
+ "content": "<|reserved_token_236|>",
1927
+ "lstrip": false,
1928
+ "normalized": false,
1929
+ "rstrip": false,
1930
+ "single_word": false,
1931
+ "special": true
1932
+ },
1933
+ "157132": {
1934
+ "content": "<|reserved_token_237|>",
1935
+ "lstrip": false,
1936
+ "normalized": false,
1937
+ "rstrip": false,
1938
+ "single_word": false,
1939
+ "special": true
1940
+ },
1941
+ "157133": {
1942
+ "content": "<|reserved_token_238|>",
1943
+ "lstrip": false,
1944
+ "normalized": false,
1945
+ "rstrip": false,
1946
+ "single_word": false,
1947
+ "special": true
1948
+ },
1949
+ "157134": {
1950
+ "content": "<|reserved_token_239|>",
1951
+ "lstrip": false,
1952
+ "normalized": false,
1953
+ "rstrip": false,
1954
+ "single_word": false,
1955
+ "special": true
1956
+ },
1957
+ "157135": {
1958
+ "content": "<|reserved_token_240|>",
1959
+ "lstrip": false,
1960
+ "normalized": false,
1961
+ "rstrip": false,
1962
+ "single_word": false,
1963
+ "special": true
1964
+ },
1965
+ "157136": {
1966
+ "content": "<|reserved_token_241|>",
1967
+ "lstrip": false,
1968
+ "normalized": false,
1969
+ "rstrip": false,
1970
+ "single_word": false,
1971
+ "special": true
1972
+ },
1973
+ "157137": {
1974
+ "content": "<|reserved_token_242|>",
1975
+ "lstrip": false,
1976
+ "normalized": false,
1977
+ "rstrip": false,
1978
+ "single_word": false,
1979
+ "special": true
1980
+ },
1981
+ "157138": {
1982
+ "content": "<|reserved_token_243|>",
1983
+ "lstrip": false,
1984
+ "normalized": false,
1985
+ "rstrip": false,
1986
+ "single_word": false,
1987
+ "special": true
1988
+ },
1989
+ "157139": {
1990
+ "content": "<|reserved_token_244|>",
1991
+ "lstrip": false,
1992
+ "normalized": false,
1993
+ "rstrip": false,
1994
+ "single_word": false,
1995
+ "special": true
1996
+ },
1997
+ "157140": {
1998
+ "content": "<|reserved_token_245|>",
1999
+ "lstrip": false,
2000
+ "normalized": false,
2001
+ "rstrip": false,
2002
+ "single_word": false,
2003
+ "special": true
2004
+ },
2005
+ "157141": {
2006
+ "content": "<|reserved_token_246|>",
2007
+ "lstrip": false,
2008
+ "normalized": false,
2009
+ "rstrip": false,
2010
+ "single_word": false,
2011
+ "special": true
2012
+ },
2013
+ "157142": {
2014
+ "content": "<|reserved_token_247|>",
2015
+ "lstrip": false,
2016
+ "normalized": false,
2017
+ "rstrip": false,
2018
+ "single_word": false,
2019
+ "special": true
2020
+ },
2021
+ "157143": {
2022
+ "content": "<|reserved_token_248|>",
2023
+ "lstrip": false,
2024
+ "normalized": false,
2025
+ "rstrip": false,
2026
+ "single_word": false,
2027
+ "special": true
2028
+ },
2029
+ "157144": {
2030
+ "content": "<|reserved_token_249|>",
2031
+ "lstrip": false,
2032
+ "normalized": false,
2033
+ "rstrip": false,
2034
+ "single_word": false,
2035
+ "special": true
2036
+ },
2037
+ "157145": {
2038
+ "content": "<|reserved_token_250|>",
2039
+ "lstrip": false,
2040
+ "normalized": false,
2041
+ "rstrip": false,
2042
+ "single_word": false,
2043
+ "special": true
2044
+ },
2045
+ "157146": {
2046
+ "content": "<|reserved_token_251|>",
2047
+ "lstrip": false,
2048
+ "normalized": false,
2049
+ "rstrip": false,
2050
+ "single_word": false,
2051
+ "special": true
2052
+ },
2053
+ "157147": {
2054
+ "content": "<|reserved_token_252|>",
2055
+ "lstrip": false,
2056
+ "normalized": false,
2057
+ "rstrip": false,
2058
+ "single_word": false,
2059
+ "special": true
2060
+ },
2061
+ "157148": {
2062
+ "content": "<|reserved_token_253|>",
2063
+ "lstrip": false,
2064
+ "normalized": false,
2065
+ "rstrip": false,
2066
+ "single_word": false,
2067
+ "special": true
2068
+ },
2069
+ "157149": {
2070
+ "content": "<|reserved_token_254|>",
2071
+ "lstrip": false,
2072
+ "normalized": false,
2073
+ "rstrip": false,
2074
+ "single_word": false,
2075
+ "special": true
2076
+ },
2077
+ "157150": {
2078
+ "content": "<|reserved_token_255|>",
2079
+ "lstrip": false,
2080
+ "normalized": false,
2081
+ "rstrip": false,
2082
+ "single_word": false,
2083
+ "special": true
2084
+ },
2085
+ "157151": {
2086
+ "content": "<role>",
2087
+ "lstrip": false,
2088
+ "normalized": false,
2089
+ "rstrip": false,
2090
+ "single_word": false,
2091
+ "special": true
2092
+ },
2093
+ "157152": {
2094
+ "content": "</role>",
2095
+ "lstrip": false,
2096
+ "normalized": false,
2097
+ "rstrip": false,
2098
+ "single_word": false,
2099
+ "special": true
2100
+ }
2101
+ },
2102
+ "bos_token": "<|startoftext|>",
2103
+ "clean_up_tokenization_spaces": false,
2104
+ "cls_token": "[CLS]",
2105
+ "eos_token": "<|endoftext|>",
2106
+ "extra_special_tokens": {},
2107
+ "fast_tokenizer": true,
2108
+ "gmask_token": "[gMASK]",
2109
+ "merges_file": null,
2110
+ "model_max_length": 1000000000000000019884624838656,
2111
+ "pad_token": "<|endoftext|>",
2112
+ "tokenizer_class": "PreTrainedTokenizerFast",
2113
+ "trust_remote_code": true
2114
+ }