Text Generation
Transformers
Safetensors
zaya
conversational
yury-zyphra commited on
Commit
de5f76a
·
verified ·
1 Parent(s): 74e4fa2

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}
2
+ {%- if messages[0]['role'] == 'system' -%}
3
+ {%- if messages[0]['content'] is string -%}
4
+ {%- set first_user_prefix = messages[0]['content'] + '
5
+
6
+ ' -%}
7
+ {%- else -%}
8
+ {%- set first_user_prefix = messages[0]['content'][0]['text'] + '
9
+
10
+ ' -%}
11
+ {%- endif -%}
12
+ {%- set loop_messages = messages[1:] -%}
13
+ {%- else -%}
14
+ {%- set first_user_prefix = "" -%}
15
+ {%- set loop_messages = messages -%}
16
+ {%- endif -%}
17
+ {%- for message in loop_messages -%}
18
+ {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
19
+ {{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
20
+ {%- endif -%}
21
+ {%- if (message['role'] == 'assistant') -%}
22
+ {%- set role = "model" -%}
23
+ {%- else -%}
24
+ {%- set role = message['role'] -%}
25
+ {%- endif -%}
26
+ {{ '<start_of_turn>' + role + '
27
+ ' + (first_user_prefix if loop.first else "") }}
28
+ {%- if message['content'] is string -%}
29
+ {{ message['content'] | trim }}
30
+ {%- elif message['content'] is iterable -%}
31
+ {%- for item in message['content'] -%}
32
+ {%- if item['type'] == 'image' -%}
33
+ {{ '<start_of_image>' }}
34
+ {%- elif item['type'] == 'text' -%}
35
+ {{ item['text'] | trim }}
36
+ {%- endif -%}
37
+ {%- endfor -%}
38
+ {%- else -%}
39
+ {{ raise_exception("Invalid content type") }}
40
+ {%- endif -%}
41
+ {{ '<end_of_turn>
42
+ ' }}
43
+ {%- endfor -%}
44
+ {%- if add_generation_prompt -%}
45
+ {{'<start_of_turn>model
46
+ '}}
47
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,452 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_func": "swiglu",
3
+ "activation_func_fp8_input_store": false,
4
+ "add_bias_linear": false,
5
+ "apply_rope_fusion": true,
6
+ "architectures": [
7
+ "ZayaForCausalLM"
8
+ ],
9
+ "attention_bias": false,
10
+ "attention_dropout": 0.0,
11
+ "bias_activation_fusion": true,
12
+ "bos_token_id": 2,
13
+ "cca": true,
14
+ "cca_num_q_heads": [
15
+ 8,
16
+ 0,
17
+ 8,
18
+ 0,
19
+ 8,
20
+ 0,
21
+ 8,
22
+ 0,
23
+ 8,
24
+ 0,
25
+ 8,
26
+ 0,
27
+ 8,
28
+ 0,
29
+ 8,
30
+ 0,
31
+ 8,
32
+ 0,
33
+ 8,
34
+ 0,
35
+ 8,
36
+ 0,
37
+ 8,
38
+ 0,
39
+ 8,
40
+ 0,
41
+ 8,
42
+ 0,
43
+ 8,
44
+ 0,
45
+ 8,
46
+ 0,
47
+ 8,
48
+ 0,
49
+ 8,
50
+ 0,
51
+ 8,
52
+ 0,
53
+ 8,
54
+ 0,
55
+ 8,
56
+ 0,
57
+ 8,
58
+ 0,
59
+ 8,
60
+ 0,
61
+ 8,
62
+ 0,
63
+ 8,
64
+ 0,
65
+ 8,
66
+ 0,
67
+ 8,
68
+ 0,
69
+ 8,
70
+ 0,
71
+ 8,
72
+ 0,
73
+ 8,
74
+ 0,
75
+ 8,
76
+ 0,
77
+ 8,
78
+ 0,
79
+ 8,
80
+ 0,
81
+ 8,
82
+ 0,
83
+ 8,
84
+ 0,
85
+ 8,
86
+ 0,
87
+ 8,
88
+ 0,
89
+ 8,
90
+ 0,
91
+ 8,
92
+ 0,
93
+ 8,
94
+ 0
95
+ ],
96
+ "dtype": "bfloat16",
97
+ "eos_token_id": 1,
98
+ "ffn_hidden_size_list": [
99
+ 0,
100
+ 4096,
101
+ 0,
102
+ 4096,
103
+ 0,
104
+ 4096,
105
+ 0,
106
+ 4096,
107
+ 0,
108
+ 4096,
109
+ 0,
110
+ 4096,
111
+ 0,
112
+ 4096,
113
+ 0,
114
+ 4096,
115
+ 0,
116
+ 4096,
117
+ 0,
118
+ 4096,
119
+ 0,
120
+ 4096,
121
+ 0,
122
+ 4096,
123
+ 0,
124
+ 4096,
125
+ 0,
126
+ 4096,
127
+ 0,
128
+ 4096,
129
+ 0,
130
+ 4096,
131
+ 0,
132
+ 4096,
133
+ 0,
134
+ 4096,
135
+ 0,
136
+ 4096,
137
+ 0,
138
+ 4096,
139
+ 0,
140
+ 4096,
141
+ 0,
142
+ 4096,
143
+ 0,
144
+ 4096,
145
+ 0,
146
+ 4096,
147
+ 0,
148
+ 4096,
149
+ 0,
150
+ 4096,
151
+ 0,
152
+ 4096,
153
+ 0,
154
+ 4096,
155
+ 0,
156
+ 4096,
157
+ 0,
158
+ 4096,
159
+ 0,
160
+ 4096,
161
+ 0,
162
+ 4096,
163
+ 0,
164
+ 4096,
165
+ 0,
166
+ 4096,
167
+ 0,
168
+ 4096,
169
+ 0,
170
+ 4096,
171
+ 0,
172
+ 4096,
173
+ 0,
174
+ 4096,
175
+ 0,
176
+ 4096,
177
+ 0,
178
+ 4096
179
+ ],
180
+ "fused_add_norm": false,
181
+ "gated_linear_unit": true,
182
+ "hidden_size": 2048,
183
+ "kv_channels": 128,
184
+ "lm_head_bias": false,
185
+ "max_position_embeddings": 32768,
186
+ "model_type": "zaya",
187
+ "moe_router_topk": 1,
188
+ "norm_epsilon": 1e-05,
189
+ "normalization": "RMSNorm",
190
+ "num_attention_heads": 16,
191
+ "num_hidden_layers": 120,
192
+ "num_key_value_heads": 2,
193
+ "num_query_groups_list": [
194
+ 2,
195
+ 0,
196
+ 2,
197
+ 0,
198
+ 2,
199
+ 0,
200
+ 2,
201
+ 0,
202
+ 2,
203
+ 0,
204
+ 2,
205
+ 0,
206
+ 2,
207
+ 0,
208
+ 2,
209
+ 0,
210
+ 2,
211
+ 0,
212
+ 2,
213
+ 0,
214
+ 2,
215
+ 0,
216
+ 2,
217
+ 0,
218
+ 2,
219
+ 0,
220
+ 2,
221
+ 0,
222
+ 2,
223
+ 0,
224
+ 2,
225
+ 0,
226
+ 2,
227
+ 0,
228
+ 2,
229
+ 0,
230
+ 2,
231
+ 0,
232
+ 2,
233
+ 0,
234
+ 2,
235
+ 0,
236
+ 2,
237
+ 0,
238
+ 2,
239
+ 0,
240
+ 2,
241
+ 0,
242
+ 2,
243
+ 0,
244
+ 2,
245
+ 0,
246
+ 2,
247
+ 0,
248
+ 2,
249
+ 0,
250
+ 2,
251
+ 0,
252
+ 2,
253
+ 0,
254
+ 2,
255
+ 0,
256
+ 2,
257
+ 0,
258
+ 2,
259
+ 0,
260
+ 2,
261
+ 0,
262
+ 2,
263
+ 0,
264
+ 2,
265
+ 0,
266
+ 2,
267
+ 0,
268
+ 2,
269
+ 0,
270
+ 2,
271
+ 0,
272
+ 2,
273
+ 0
274
+ ],
275
+ "pad_token_id": 0,
276
+ "residual_in_fp32": false,
277
+ "partial_rotary_factor": 0.5,
278
+ "rope_scaling": false,
279
+ "rope_theta": 1000000,
280
+ "scale_residual_merge": true,
281
+ "sliding_window": null,
282
+ "zaya_high_prec": true,
283
+ "zaya_layers": [
284
+ "a",
285
+ 16,
286
+ "a",
287
+ 16,
288
+ "a",
289
+ 16,
290
+ "a",
291
+ 16,
292
+ "a",
293
+ 16,
294
+ "a",
295
+ 16,
296
+ "a",
297
+ 16,
298
+ "a",
299
+ 16,
300
+ "a",
301
+ 16,
302
+ "a",
303
+ 16,
304
+ "a",
305
+ 16,
306
+ "a",
307
+ 16,
308
+ "a",
309
+ 16,
310
+ "a",
311
+ 16,
312
+ "a",
313
+ 16,
314
+ "a",
315
+ 16,
316
+ "a",
317
+ 16,
318
+ "a",
319
+ 16,
320
+ "a",
321
+ 16,
322
+ "a",
323
+ 16,
324
+ "a",
325
+ 16,
326
+ "a",
327
+ 16,
328
+ "a",
329
+ 16,
330
+ "a",
331
+ 16,
332
+ "a",
333
+ 16,
334
+ "a",
335
+ 16,
336
+ "a",
337
+ 16,
338
+ "a",
339
+ 16,
340
+ "a",
341
+ 16,
342
+ "a",
343
+ 16,
344
+ "a",
345
+ 16,
346
+ "a",
347
+ 16,
348
+ "a",
349
+ 16,
350
+ "a",
351
+ 16,
352
+ "a",
353
+ 16,
354
+ "a",
355
+ 16,
356
+ "a",
357
+ 16,
358
+ "a",
359
+ 16,
360
+ "a",
361
+ 16,
362
+ "a",
363
+ 16
364
+ ],
365
+ "zaya_mlp_expansion": [
366
+ 0,
367
+ 256,
368
+ 0,
369
+ 256,
370
+ 0,
371
+ 256,
372
+ 0,
373
+ 256,
374
+ 0,
375
+ 256,
376
+ 0,
377
+ 256,
378
+ 0,
379
+ 256,
380
+ 0,
381
+ 256,
382
+ 0,
383
+ 256,
384
+ 0,
385
+ 256,
386
+ 0,
387
+ 256,
388
+ 0,
389
+ 256,
390
+ 0,
391
+ 256,
392
+ 0,
393
+ 256,
394
+ 0,
395
+ 256,
396
+ 0,
397
+ 256,
398
+ 0,
399
+ 256,
400
+ 0,
401
+ 256,
402
+ 0,
403
+ 256,
404
+ 0,
405
+ 256,
406
+ 0,
407
+ 256,
408
+ 0,
409
+ 256,
410
+ 0,
411
+ 256,
412
+ 0,
413
+ 256,
414
+ 0,
415
+ 256,
416
+ 0,
417
+ 256,
418
+ 0,
419
+ 256,
420
+ 0,
421
+ 256,
422
+ 0,
423
+ 256,
424
+ 0,
425
+ 256,
426
+ 0,
427
+ 256,
428
+ 0,
429
+ 256,
430
+ 0,
431
+ 256,
432
+ 0,
433
+ 256,
434
+ 0,
435
+ 256,
436
+ 0,
437
+ 256,
438
+ 0,
439
+ 256,
440
+ 0,
441
+ 256,
442
+ 0,
443
+ 256,
444
+ 0,
445
+ 256
446
+ ],
447
+ "zaya_use_eda": true,
448
+ "zaya_use_mod": true,
449
+ "transformers_version": "4.57.1",
450
+ "use_cache": true,
451
+ "vocab_size": 262272
452
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 2,
4
+ "eos_token_id": 1,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "4.57.1"
7
+ }
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4cf177bb3b07258a3d31be0d8092ac5d829c5e0ee5179493fe48ac39e1a4930
3
+ size 4999499392
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7000db19fe15e7def8dd4265d7a004632715533f1f9fbb207823975e992216bc
3
+ size 4998887440
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1593800d69c549a2ac9c9043fd8e6bec43ac4ebf360d4a77ab89c3773d30f62
3
+ size 4990498832
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d877998bfde631c1fe8f44b904419ff3c43119cd54ad8a99c614afb22412505a
3
+ size 2692425872
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "boi_token": "<start_of_image>",
3
+ "bos_token": {
4
+ "content": "<bos>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ "eoi_token": "<end_of_image>",
11
+ "eos_token": {
12
+ "content": "<eos>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "image_token": "<image_soft_token>",
19
+ "pad_token": {
20
+ "content": "<pad>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<unk>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b244434a1e668213b5494c816f8077d7b5b64bdac094ea09e7aaf6281b77f00
3
+ size 33384937
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff