upload asq moe quantized model
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- config.json +454 -0
- configuration_deepseek.py +210 -0
- generation_config.json +9 -0
- model-00001-of-00076.safetensors +3 -0
- model-00002-of-00076.safetensors +3 -0
- model-00003-of-00076.safetensors +3 -0
- model-00004-of-00076.safetensors +3 -0
- model-00005-of-00076.safetensors +3 -0
- model-00006-of-00076.safetensors +3 -0
- model-00007-of-00076.safetensors +3 -0
- model-00008-of-00076.safetensors +3 -0
- model-00009-of-00076.safetensors +3 -0
- model-00010-of-00076.safetensors +3 -0
- model-00011-of-00076.safetensors +3 -0
- model-00012-of-00076.safetensors +3 -0
- model-00013-of-00076.safetensors +3 -0
- model-00014-of-00076.safetensors +3 -0
- model-00015-of-00076.safetensors +3 -0
- model-00016-of-00076.safetensors +3 -0
- model-00017-of-00076.safetensors +3 -0
- model-00018-of-00076.safetensors +3 -0
- model-00019-of-00076.safetensors +3 -0
- model-00020-of-00076.safetensors +3 -0
- model-00021-of-00076.safetensors +3 -0
- model-00022-of-00076.safetensors +3 -0
- model-00023-of-00076.safetensors +3 -0
- model-00024-of-00076.safetensors +3 -0
- model-00025-of-00076.safetensors +3 -0
- model-00026-of-00076.safetensors +3 -0
- model-00027-of-00076.safetensors +3 -0
- model-00028-of-00076.safetensors +3 -0
- model-00029-of-00076.safetensors +3 -0
- model-00030-of-00076.safetensors +3 -0
- model-00031-of-00076.safetensors +3 -0
- model-00032-of-00076.safetensors +3 -0
- model-00033-of-00076.safetensors +3 -0
- model-00034-of-00076.safetensors +3 -0
- model-00035-of-00076.safetensors +3 -0
- model-00036-of-00076.safetensors +3 -0
- model-00037-of-00076.safetensors +3 -0
- model-00038-of-00076.safetensors +3 -0
- model-00039-of-00076.safetensors +3 -0
- model-00040-of-00076.safetensors +3 -0
- model-00041-of-00076.safetensors +3 -0
- model-00042-of-00076.safetensors +3 -0
- model-00043-of-00076.safetensors +3 -0
- model-00044-of-00076.safetensors +3 -0
- model-00045-of-00076.safetensors +3 -0
- model-00046-of-00076.safetensors +3 -0
- model-00047-of-00076.safetensors +3 -0
config.json
ADDED
@@ -0,0 +1,454 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"DeepseekV3ForCausalLM"
|
4 |
+
],
|
5 |
+
"attention_bias": false,
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"auto_map": {
|
8 |
+
"AutoConfig": "configuration_deepseek.DeepseekV3Config",
|
9 |
+
"AutoModel": "modeling_deepseek.DeepseekV3Model",
|
10 |
+
"AutoModelForCausalLM": "modeling_deepseek.DeepseekV3ForCausalLM"
|
11 |
+
},
|
12 |
+
"aux_loss_alpha": 0.001,
|
13 |
+
"bos_token_id": 0,
|
14 |
+
"eos_token_id": 1,
|
15 |
+
"ep_size": 1,
|
16 |
+
"first_k_dense_replace": 3,
|
17 |
+
"hidden_act": "silu",
|
18 |
+
"hidden_size": 7168,
|
19 |
+
"initializer_range": 0.02,
|
20 |
+
"intermediate_size": 18432,
|
21 |
+
"kv_lora_rank": 512,
|
22 |
+
"max_position_embeddings": 163840,
|
23 |
+
"model_type": "deepseek_v3",
|
24 |
+
"moe_intermediate_size": 2048,
|
25 |
+
"moe_layer_freq": 1,
|
26 |
+
"n_group": 8,
|
27 |
+
"n_routed_experts": 256,
|
28 |
+
"n_shared_experts": 1,
|
29 |
+
"norm_topk_prob": true,
|
30 |
+
"num_attention_heads": 128,
|
31 |
+
"num_experts_per_tok": 8,
|
32 |
+
"num_hidden_layers": 61,
|
33 |
+
"num_key_value_heads": 128,
|
34 |
+
"num_nextn_predict_layers": 1,
|
35 |
+
"pad_token_id": 128815,
|
36 |
+
"pretraining_tp": 1,
|
37 |
+
"q_lora_rank": 1536,
|
38 |
+
"qk_nope_head_dim": 128,
|
39 |
+
"qk_rope_head_dim": 64,
|
40 |
+
"quantization_config": {
|
41 |
+
"algo_config": {
|
42 |
+
"compute_scale_loss": "MAE",
|
43 |
+
"model_decoder_layers": "model.layers",
|
44 |
+
"name": "autosmoothquant",
|
45 |
+
"num_attention_heads": -1,
|
46 |
+
"num_key_value_heads": -1,
|
47 |
+
"scaling_layers": [
|
48 |
+
{
|
49 |
+
"inp": "mlp.gate_proj",
|
50 |
+
"layers": [
|
51 |
+
"mlp.gate_proj",
|
52 |
+
"mlp.up_proj"
|
53 |
+
],
|
54 |
+
"module2inspect": "mlp",
|
55 |
+
"prev_op": "post_attention_layernorm"
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"inp": "mlp.down_proj",
|
59 |
+
"layers": [
|
60 |
+
"mlp.down_proj"
|
61 |
+
],
|
62 |
+
"prev_op": "mlp.up_proj"
|
63 |
+
},
|
64 |
+
{
|
65 |
+
"inp": "down_proj",
|
66 |
+
"layers": [
|
67 |
+
"down_proj"
|
68 |
+
],
|
69 |
+
"prev_op": "up_proj"
|
70 |
+
}
|
71 |
+
]
|
72 |
+
},
|
73 |
+
"exclude": [
|
74 |
+
"model.layers.0.self_attn.q_a_proj",
|
75 |
+
"model.layers.0.self_attn.q_b_proj",
|
76 |
+
"model.layers.0.self_attn.kv_a_proj_with_mqa",
|
77 |
+
"model.layers.0.self_attn.kv_b_proj",
|
78 |
+
"model.layers.0.self_attn.o_proj",
|
79 |
+
"model.layers.1.self_attn.q_a_proj",
|
80 |
+
"model.layers.1.self_attn.q_b_proj",
|
81 |
+
"model.layers.1.self_attn.kv_a_proj_with_mqa",
|
82 |
+
"model.layers.1.self_attn.kv_b_proj",
|
83 |
+
"model.layers.1.self_attn.o_proj",
|
84 |
+
"model.layers.2.self_attn.q_a_proj",
|
85 |
+
"model.layers.2.self_attn.q_b_proj",
|
86 |
+
"model.layers.2.self_attn.kv_a_proj_with_mqa",
|
87 |
+
"model.layers.2.self_attn.kv_b_proj",
|
88 |
+
"model.layers.2.self_attn.o_proj",
|
89 |
+
"model.layers.3.self_attn.q_a_proj",
|
90 |
+
"model.layers.3.self_attn.q_b_proj",
|
91 |
+
"model.layers.3.self_attn.kv_a_proj_with_mqa",
|
92 |
+
"model.layers.3.self_attn.kv_b_proj",
|
93 |
+
"model.layers.3.self_attn.o_proj",
|
94 |
+
"model.layers.4.self_attn.q_a_proj",
|
95 |
+
"model.layers.4.self_attn.q_b_proj",
|
96 |
+
"model.layers.4.self_attn.kv_a_proj_with_mqa",
|
97 |
+
"model.layers.4.self_attn.kv_b_proj",
|
98 |
+
"model.layers.4.self_attn.o_proj",
|
99 |
+
"model.layers.5.self_attn.q_a_proj",
|
100 |
+
"model.layers.5.self_attn.q_b_proj",
|
101 |
+
"model.layers.5.self_attn.kv_a_proj_with_mqa",
|
102 |
+
"model.layers.5.self_attn.kv_b_proj",
|
103 |
+
"model.layers.5.self_attn.o_proj",
|
104 |
+
"model.layers.6.self_attn.q_a_proj",
|
105 |
+
"model.layers.6.self_attn.q_b_proj",
|
106 |
+
"model.layers.6.self_attn.kv_a_proj_with_mqa",
|
107 |
+
"model.layers.6.self_attn.kv_b_proj",
|
108 |
+
"model.layers.6.self_attn.o_proj",
|
109 |
+
"model.layers.7.self_attn.q_a_proj",
|
110 |
+
"model.layers.7.self_attn.q_b_proj",
|
111 |
+
"model.layers.7.self_attn.kv_a_proj_with_mqa",
|
112 |
+
"model.layers.7.self_attn.kv_b_proj",
|
113 |
+
"model.layers.7.self_attn.o_proj",
|
114 |
+
"model.layers.8.self_attn.q_a_proj",
|
115 |
+
"model.layers.8.self_attn.q_b_proj",
|
116 |
+
"model.layers.8.self_attn.kv_a_proj_with_mqa",
|
117 |
+
"model.layers.8.self_attn.kv_b_proj",
|
118 |
+
"model.layers.8.self_attn.o_proj",
|
119 |
+
"model.layers.9.self_attn.q_a_proj",
|
120 |
+
"model.layers.9.self_attn.q_b_proj",
|
121 |
+
"model.layers.9.self_attn.kv_a_proj_with_mqa",
|
122 |
+
"model.layers.9.self_attn.kv_b_proj",
|
123 |
+
"model.layers.9.self_attn.o_proj",
|
124 |
+
"model.layers.10.self_attn.q_a_proj",
|
125 |
+
"model.layers.10.self_attn.q_b_proj",
|
126 |
+
"model.layers.10.self_attn.kv_a_proj_with_mqa",
|
127 |
+
"model.layers.10.self_attn.kv_b_proj",
|
128 |
+
"model.layers.10.self_attn.o_proj",
|
129 |
+
"model.layers.11.self_attn.q_a_proj",
|
130 |
+
"model.layers.11.self_attn.q_b_proj",
|
131 |
+
"model.layers.11.self_attn.kv_a_proj_with_mqa",
|
132 |
+
"model.layers.11.self_attn.kv_b_proj",
|
133 |
+
"model.layers.11.self_attn.o_proj",
|
134 |
+
"model.layers.12.self_attn.q_a_proj",
|
135 |
+
"model.layers.12.self_attn.q_b_proj",
|
136 |
+
"model.layers.12.self_attn.kv_a_proj_with_mqa",
|
137 |
+
"model.layers.12.self_attn.kv_b_proj",
|
138 |
+
"model.layers.12.self_attn.o_proj",
|
139 |
+
"model.layers.13.self_attn.q_a_proj",
|
140 |
+
"model.layers.13.self_attn.q_b_proj",
|
141 |
+
"model.layers.13.self_attn.kv_a_proj_with_mqa",
|
142 |
+
"model.layers.13.self_attn.kv_b_proj",
|
143 |
+
"model.layers.13.self_attn.o_proj",
|
144 |
+
"model.layers.14.self_attn.q_a_proj",
|
145 |
+
"model.layers.14.self_attn.q_b_proj",
|
146 |
+
"model.layers.14.self_attn.kv_a_proj_with_mqa",
|
147 |
+
"model.layers.14.self_attn.kv_b_proj",
|
148 |
+
"model.layers.14.self_attn.o_proj",
|
149 |
+
"model.layers.15.self_attn.q_a_proj",
|
150 |
+
"model.layers.15.self_attn.q_b_proj",
|
151 |
+
"model.layers.15.self_attn.kv_a_proj_with_mqa",
|
152 |
+
"model.layers.15.self_attn.kv_b_proj",
|
153 |
+
"model.layers.15.self_attn.o_proj",
|
154 |
+
"model.layers.16.self_attn.q_a_proj",
|
155 |
+
"model.layers.16.self_attn.q_b_proj",
|
156 |
+
"model.layers.16.self_attn.kv_a_proj_with_mqa",
|
157 |
+
"model.layers.16.self_attn.kv_b_proj",
|
158 |
+
"model.layers.16.self_attn.o_proj",
|
159 |
+
"model.layers.17.self_attn.q_a_proj",
|
160 |
+
"model.layers.17.self_attn.q_b_proj",
|
161 |
+
"model.layers.17.self_attn.kv_a_proj_with_mqa",
|
162 |
+
"model.layers.17.self_attn.kv_b_proj",
|
163 |
+
"model.layers.17.self_attn.o_proj",
|
164 |
+
"model.layers.18.self_attn.q_a_proj",
|
165 |
+
"model.layers.18.self_attn.q_b_proj",
|
166 |
+
"model.layers.18.self_attn.kv_a_proj_with_mqa",
|
167 |
+
"model.layers.18.self_attn.kv_b_proj",
|
168 |
+
"model.layers.18.self_attn.o_proj",
|
169 |
+
"model.layers.19.self_attn.q_a_proj",
|
170 |
+
"model.layers.19.self_attn.q_b_proj",
|
171 |
+
"model.layers.19.self_attn.kv_a_proj_with_mqa",
|
172 |
+
"model.layers.19.self_attn.kv_b_proj",
|
173 |
+
"model.layers.19.self_attn.o_proj",
|
174 |
+
"model.layers.20.self_attn.q_a_proj",
|
175 |
+
"model.layers.20.self_attn.q_b_proj",
|
176 |
+
"model.layers.20.self_attn.kv_a_proj_with_mqa",
|
177 |
+
"model.layers.20.self_attn.kv_b_proj",
|
178 |
+
"model.layers.20.self_attn.o_proj",
|
179 |
+
"model.layers.21.self_attn.q_a_proj",
|
180 |
+
"model.layers.21.self_attn.q_b_proj",
|
181 |
+
"model.layers.21.self_attn.kv_a_proj_with_mqa",
|
182 |
+
"model.layers.21.self_attn.kv_b_proj",
|
183 |
+
"model.layers.21.self_attn.o_proj",
|
184 |
+
"model.layers.22.self_attn.q_a_proj",
|
185 |
+
"model.layers.22.self_attn.q_b_proj",
|
186 |
+
"model.layers.22.self_attn.kv_a_proj_with_mqa",
|
187 |
+
"model.layers.22.self_attn.kv_b_proj",
|
188 |
+
"model.layers.22.self_attn.o_proj",
|
189 |
+
"model.layers.23.self_attn.q_a_proj",
|
190 |
+
"model.layers.23.self_attn.q_b_proj",
|
191 |
+
"model.layers.23.self_attn.kv_a_proj_with_mqa",
|
192 |
+
"model.layers.23.self_attn.kv_b_proj",
|
193 |
+
"model.layers.23.self_attn.o_proj",
|
194 |
+
"model.layers.24.self_attn.q_a_proj",
|
195 |
+
"model.layers.24.self_attn.q_b_proj",
|
196 |
+
"model.layers.24.self_attn.kv_a_proj_with_mqa",
|
197 |
+
"model.layers.24.self_attn.kv_b_proj",
|
198 |
+
"model.layers.24.self_attn.o_proj",
|
199 |
+
"model.layers.25.self_attn.q_a_proj",
|
200 |
+
"model.layers.25.self_attn.q_b_proj",
|
201 |
+
"model.layers.25.self_attn.kv_a_proj_with_mqa",
|
202 |
+
"model.layers.25.self_attn.kv_b_proj",
|
203 |
+
"model.layers.25.self_attn.o_proj",
|
204 |
+
"model.layers.26.self_attn.q_a_proj",
|
205 |
+
"model.layers.26.self_attn.q_b_proj",
|
206 |
+
"model.layers.26.self_attn.kv_a_proj_with_mqa",
|
207 |
+
"model.layers.26.self_attn.kv_b_proj",
|
208 |
+
"model.layers.26.self_attn.o_proj",
|
209 |
+
"model.layers.27.self_attn.q_a_proj",
|
210 |
+
"model.layers.27.self_attn.q_b_proj",
|
211 |
+
"model.layers.27.self_attn.kv_a_proj_with_mqa",
|
212 |
+
"model.layers.27.self_attn.kv_b_proj",
|
213 |
+
"model.layers.27.self_attn.o_proj",
|
214 |
+
"model.layers.28.self_attn.q_a_proj",
|
215 |
+
"model.layers.28.self_attn.q_b_proj",
|
216 |
+
"model.layers.28.self_attn.kv_a_proj_with_mqa",
|
217 |
+
"model.layers.28.self_attn.kv_b_proj",
|
218 |
+
"model.layers.28.self_attn.o_proj",
|
219 |
+
"model.layers.29.self_attn.q_a_proj",
|
220 |
+
"model.layers.29.self_attn.q_b_proj",
|
221 |
+
"model.layers.29.self_attn.kv_a_proj_with_mqa",
|
222 |
+
"model.layers.29.self_attn.kv_b_proj",
|
223 |
+
"model.layers.29.self_attn.o_proj",
|
224 |
+
"model.layers.30.self_attn.q_a_proj",
|
225 |
+
"model.layers.30.self_attn.q_b_proj",
|
226 |
+
"model.layers.30.self_attn.kv_a_proj_with_mqa",
|
227 |
+
"model.layers.30.self_attn.kv_b_proj",
|
228 |
+
"model.layers.30.self_attn.o_proj",
|
229 |
+
"model.layers.31.self_attn.q_a_proj",
|
230 |
+
"model.layers.31.self_attn.q_b_proj",
|
231 |
+
"model.layers.31.self_attn.kv_a_proj_with_mqa",
|
232 |
+
"model.layers.31.self_attn.kv_b_proj",
|
233 |
+
"model.layers.31.self_attn.o_proj",
|
234 |
+
"model.layers.32.self_attn.q_a_proj",
|
235 |
+
"model.layers.32.self_attn.q_b_proj",
|
236 |
+
"model.layers.32.self_attn.kv_a_proj_with_mqa",
|
237 |
+
"model.layers.32.self_attn.kv_b_proj",
|
238 |
+
"model.layers.32.self_attn.o_proj",
|
239 |
+
"model.layers.33.self_attn.q_a_proj",
|
240 |
+
"model.layers.33.self_attn.q_b_proj",
|
241 |
+
"model.layers.33.self_attn.kv_a_proj_with_mqa",
|
242 |
+
"model.layers.33.self_attn.kv_b_proj",
|
243 |
+
"model.layers.33.self_attn.o_proj",
|
244 |
+
"model.layers.34.self_attn.q_a_proj",
|
245 |
+
"model.layers.34.self_attn.q_b_proj",
|
246 |
+
"model.layers.34.self_attn.kv_a_proj_with_mqa",
|
247 |
+
"model.layers.34.self_attn.kv_b_proj",
|
248 |
+
"model.layers.34.self_attn.o_proj",
|
249 |
+
"model.layers.35.self_attn.q_a_proj",
|
250 |
+
"model.layers.35.self_attn.q_b_proj",
|
251 |
+
"model.layers.35.self_attn.kv_a_proj_with_mqa",
|
252 |
+
"model.layers.35.self_attn.kv_b_proj",
|
253 |
+
"model.layers.35.self_attn.o_proj",
|
254 |
+
"model.layers.36.self_attn.q_a_proj",
|
255 |
+
"model.layers.36.self_attn.q_b_proj",
|
256 |
+
"model.layers.36.self_attn.kv_a_proj_with_mqa",
|
257 |
+
"model.layers.36.self_attn.kv_b_proj",
|
258 |
+
"model.layers.36.self_attn.o_proj",
|
259 |
+
"model.layers.37.self_attn.q_a_proj",
|
260 |
+
"model.layers.37.self_attn.q_b_proj",
|
261 |
+
"model.layers.37.self_attn.kv_a_proj_with_mqa",
|
262 |
+
"model.layers.37.self_attn.kv_b_proj",
|
263 |
+
"model.layers.37.self_attn.o_proj",
|
264 |
+
"model.layers.38.self_attn.q_a_proj",
|
265 |
+
"model.layers.38.self_attn.q_b_proj",
|
266 |
+
"model.layers.38.self_attn.kv_a_proj_with_mqa",
|
267 |
+
"model.layers.38.self_attn.kv_b_proj",
|
268 |
+
"model.layers.38.self_attn.o_proj",
|
269 |
+
"model.layers.39.self_attn.q_a_proj",
|
270 |
+
"model.layers.39.self_attn.q_b_proj",
|
271 |
+
"model.layers.39.self_attn.kv_a_proj_with_mqa",
|
272 |
+
"model.layers.39.self_attn.kv_b_proj",
|
273 |
+
"model.layers.39.self_attn.o_proj",
|
274 |
+
"model.layers.40.self_attn.q_a_proj",
|
275 |
+
"model.layers.40.self_attn.q_b_proj",
|
276 |
+
"model.layers.40.self_attn.kv_a_proj_with_mqa",
|
277 |
+
"model.layers.40.self_attn.kv_b_proj",
|
278 |
+
"model.layers.40.self_attn.o_proj",
|
279 |
+
"model.layers.41.self_attn.q_a_proj",
|
280 |
+
"model.layers.41.self_attn.q_b_proj",
|
281 |
+
"model.layers.41.self_attn.kv_a_proj_with_mqa",
|
282 |
+
"model.layers.41.self_attn.kv_b_proj",
|
283 |
+
"model.layers.41.self_attn.o_proj",
|
284 |
+
"model.layers.42.self_attn.q_a_proj",
|
285 |
+
"model.layers.42.self_attn.q_b_proj",
|
286 |
+
"model.layers.42.self_attn.kv_a_proj_with_mqa",
|
287 |
+
"model.layers.42.self_attn.kv_b_proj",
|
288 |
+
"model.layers.42.self_attn.o_proj",
|
289 |
+
"model.layers.43.self_attn.q_a_proj",
|
290 |
+
"model.layers.43.self_attn.q_b_proj",
|
291 |
+
"model.layers.43.self_attn.kv_a_proj_with_mqa",
|
292 |
+
"model.layers.43.self_attn.kv_b_proj",
|
293 |
+
"model.layers.43.self_attn.o_proj",
|
294 |
+
"model.layers.44.self_attn.q_a_proj",
|
295 |
+
"model.layers.44.self_attn.q_b_proj",
|
296 |
+
"model.layers.44.self_attn.kv_a_proj_with_mqa",
|
297 |
+
"model.layers.44.self_attn.kv_b_proj",
|
298 |
+
"model.layers.44.self_attn.o_proj",
|
299 |
+
"model.layers.45.self_attn.q_a_proj",
|
300 |
+
"model.layers.45.self_attn.q_b_proj",
|
301 |
+
"model.layers.45.self_attn.kv_a_proj_with_mqa",
|
302 |
+
"model.layers.45.self_attn.kv_b_proj",
|
303 |
+
"model.layers.45.self_attn.o_proj",
|
304 |
+
"model.layers.46.self_attn.q_a_proj",
|
305 |
+
"model.layers.46.self_attn.q_b_proj",
|
306 |
+
"model.layers.46.self_attn.kv_a_proj_with_mqa",
|
307 |
+
"model.layers.46.self_attn.kv_b_proj",
|
308 |
+
"model.layers.46.self_attn.o_proj",
|
309 |
+
"model.layers.47.self_attn.q_a_proj",
|
310 |
+
"model.layers.47.self_attn.q_b_proj",
|
311 |
+
"model.layers.47.self_attn.kv_a_proj_with_mqa",
|
312 |
+
"model.layers.47.self_attn.kv_b_proj",
|
313 |
+
"model.layers.47.self_attn.o_proj",
|
314 |
+
"model.layers.48.self_attn.q_a_proj",
|
315 |
+
"model.layers.48.self_attn.q_b_proj",
|
316 |
+
"model.layers.48.self_attn.kv_a_proj_with_mqa",
|
317 |
+
"model.layers.48.self_attn.kv_b_proj",
|
318 |
+
"model.layers.48.self_attn.o_proj",
|
319 |
+
"model.layers.49.self_attn.q_a_proj",
|
320 |
+
"model.layers.49.self_attn.q_b_proj",
|
321 |
+
"model.layers.49.self_attn.kv_a_proj_with_mqa",
|
322 |
+
"model.layers.49.self_attn.kv_b_proj",
|
323 |
+
"model.layers.49.self_attn.o_proj",
|
324 |
+
"model.layers.50.self_attn.q_a_proj",
|
325 |
+
"model.layers.50.self_attn.q_b_proj",
|
326 |
+
"model.layers.50.self_attn.kv_a_proj_with_mqa",
|
327 |
+
"model.layers.50.self_attn.kv_b_proj",
|
328 |
+
"model.layers.50.self_attn.o_proj",
|
329 |
+
"model.layers.51.self_attn.q_a_proj",
|
330 |
+
"model.layers.51.self_attn.q_b_proj",
|
331 |
+
"model.layers.51.self_attn.kv_a_proj_with_mqa",
|
332 |
+
"model.layers.51.self_attn.kv_b_proj",
|
333 |
+
"model.layers.51.self_attn.o_proj",
|
334 |
+
"model.layers.52.self_attn.q_a_proj",
|
335 |
+
"model.layers.52.self_attn.q_b_proj",
|
336 |
+
"model.layers.52.self_attn.kv_a_proj_with_mqa",
|
337 |
+
"model.layers.52.self_attn.kv_b_proj",
|
338 |
+
"model.layers.52.self_attn.o_proj",
|
339 |
+
"model.layers.53.self_attn.q_a_proj",
|
340 |
+
"model.layers.53.self_attn.q_b_proj",
|
341 |
+
"model.layers.53.self_attn.kv_a_proj_with_mqa",
|
342 |
+
"model.layers.53.self_attn.kv_b_proj",
|
343 |
+
"model.layers.53.self_attn.o_proj",
|
344 |
+
"model.layers.54.self_attn.q_a_proj",
|
345 |
+
"model.layers.54.self_attn.q_b_proj",
|
346 |
+
"model.layers.54.self_attn.kv_a_proj_with_mqa",
|
347 |
+
"model.layers.54.self_attn.kv_b_proj",
|
348 |
+
"model.layers.54.self_attn.o_proj",
|
349 |
+
"model.layers.55.self_attn.q_a_proj",
|
350 |
+
"model.layers.55.self_attn.q_b_proj",
|
351 |
+
"model.layers.55.self_attn.kv_a_proj_with_mqa",
|
352 |
+
"model.layers.55.self_attn.kv_b_proj",
|
353 |
+
"model.layers.55.self_attn.o_proj",
|
354 |
+
"model.layers.56.self_attn.q_a_proj",
|
355 |
+
"model.layers.56.self_attn.q_b_proj",
|
356 |
+
"model.layers.56.self_attn.kv_a_proj_with_mqa",
|
357 |
+
"model.layers.56.self_attn.kv_b_proj",
|
358 |
+
"model.layers.56.self_attn.o_proj",
|
359 |
+
"model.layers.57.self_attn.q_a_proj",
|
360 |
+
"model.layers.57.self_attn.q_b_proj",
|
361 |
+
"model.layers.57.self_attn.kv_a_proj_with_mqa",
|
362 |
+
"model.layers.57.self_attn.kv_b_proj",
|
363 |
+
"model.layers.57.self_attn.o_proj",
|
364 |
+
"model.layers.58.self_attn.q_a_proj",
|
365 |
+
"model.layers.58.self_attn.q_b_proj",
|
366 |
+
"model.layers.58.self_attn.kv_a_proj_with_mqa",
|
367 |
+
"model.layers.58.self_attn.kv_b_proj",
|
368 |
+
"model.layers.58.self_attn.o_proj",
|
369 |
+
"model.layers.59.self_attn.q_a_proj",
|
370 |
+
"model.layers.59.self_attn.q_b_proj",
|
371 |
+
"model.layers.59.self_attn.kv_a_proj_with_mqa",
|
372 |
+
"model.layers.59.self_attn.kv_b_proj",
|
373 |
+
"model.layers.59.self_attn.o_proj",
|
374 |
+
"model.layers.60.self_attn.q_a_proj",
|
375 |
+
"model.layers.60.self_attn.q_b_proj",
|
376 |
+
"model.layers.60.self_attn.kv_a_proj_with_mqa",
|
377 |
+
"model.layers.60.self_attn.kv_b_proj",
|
378 |
+
"model.layers.60.self_attn.o_proj",
|
379 |
+
"lm_head"
|
380 |
+
],
|
381 |
+
"export": {
|
382 |
+
"kv_cache_group": [],
|
383 |
+
"min_kv_scale": 0.0,
|
384 |
+
"pack_method": "reorder",
|
385 |
+
"weight_format": "real_quantized",
|
386 |
+
"weight_merge_groups": null
|
387 |
+
},
|
388 |
+
"global_quant_config": {
|
389 |
+
"bias": null,
|
390 |
+
"input_tensors": {
|
391 |
+
"ch_axis": -1,
|
392 |
+
"dtype": "fp4",
|
393 |
+
"group_size": 32,
|
394 |
+
"is_dynamic": true,
|
395 |
+
"is_mx_scale_constraint": false,
|
396 |
+
"is_scale_quant": false,
|
397 |
+
"mx_element_dtype": null,
|
398 |
+
"observer_cls": "PerBlockMXObserver",
|
399 |
+
"qscheme": "per_group",
|
400 |
+
"round_method": "half_even",
|
401 |
+
"scale_calculation_mode": "even",
|
402 |
+
"scale_format": "e8m0",
|
403 |
+
"scale_type": "float",
|
404 |
+
"symmetric": null
|
405 |
+
},
|
406 |
+
"output_tensors": null,
|
407 |
+
"target_device": null,
|
408 |
+
"weight": {
|
409 |
+
"ch_axis": -1,
|
410 |
+
"dtype": "fp4",
|
411 |
+
"group_size": 32,
|
412 |
+
"is_dynamic": false,
|
413 |
+
"is_mx_scale_constraint": false,
|
414 |
+
"is_scale_quant": false,
|
415 |
+
"mx_element_dtype": null,
|
416 |
+
"observer_cls": "PerBlockMXObserver",
|
417 |
+
"qscheme": "per_group",
|
418 |
+
"round_method": "half_even",
|
419 |
+
"scale_calculation_mode": "even",
|
420 |
+
"scale_format": "e8m0",
|
421 |
+
"scale_type": "float",
|
422 |
+
"symmetric": null
|
423 |
+
}
|
424 |
+
},
|
425 |
+
"layer_quant_config": {},
|
426 |
+
"layer_type_quant_config": {},
|
427 |
+
"quant_method": "quark",
|
428 |
+
"quant_mode": "eager_mode",
|
429 |
+
"softmax_quant_spec": null
|
430 |
+
},
|
431 |
+
"rms_norm_eps": 1e-06,
|
432 |
+
"rope_scaling": {
|
433 |
+
"beta_fast": 32,
|
434 |
+
"beta_slow": 1,
|
435 |
+
"factor": 40,
|
436 |
+
"mscale": 1.0,
|
437 |
+
"mscale_all_dim": 1.0,
|
438 |
+
"original_max_position_embeddings": 4096,
|
439 |
+
"type": "yarn"
|
440 |
+
},
|
441 |
+
"rope_theta": 10000,
|
442 |
+
"routed_scaling_factor": 2.5,
|
443 |
+
"scoring_func": "sigmoid",
|
444 |
+
"seq_aux": true,
|
445 |
+
"tie_word_embeddings": false,
|
446 |
+
"topk_group": 4,
|
447 |
+
"topk_method": "noaux_tc",
|
448 |
+
"torch_dtype": "bfloat16",
|
449 |
+
"transformers_version": "4.51.3",
|
450 |
+
"unsloth_fixed": true,
|
451 |
+
"use_cache": true,
|
452 |
+
"v_head_dim": 128,
|
453 |
+
"vocab_size": 129280
|
454 |
+
}
|
configuration_deepseek.py
ADDED
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers.configuration_utils import PretrainedConfig
|
2 |
+
from transformers.utils import logging
|
3 |
+
|
4 |
+
logger = logging.get_logger(__name__)
|
5 |
+
|
6 |
+
DEEPSEEK_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
|
7 |
+
class DeepseekV3Config(PretrainedConfig):
|
8 |
+
r"""
|
9 |
+
This is the configuration class to store the configuration of a [`DeepseekV3Model`]. It is used to instantiate an DeepSeek
|
10 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
11 |
+
defaults will yield a similar configuration to that of the DeepSeek-V3.
|
12 |
+
|
13 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
14 |
+
documentation from [`PretrainedConfig`] for more information.
|
15 |
+
|
16 |
+
|
17 |
+
Args:
|
18 |
+
vocab_size (`int`, *optional*, defaults to 129280):
|
19 |
+
Vocabulary size of the Deep model. Defines the number of different tokens that can be represented by the
|
20 |
+
`inputs_ids` passed when calling [`DeepseekV3Model`]
|
21 |
+
hidden_size (`int`, *optional*, defaults to 4096):
|
22 |
+
Dimension of the hidden representations.
|
23 |
+
intermediate_size (`int`, *optional*, defaults to 11008):
|
24 |
+
Dimension of the MLP representations.
|
25 |
+
moe_intermediate_size (`int`, *optional*, defaults to 1407):
|
26 |
+
Dimension of the MoE representations.
|
27 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
28 |
+
Number of hidden layers in the Transformer decoder.
|
29 |
+
num_nextn_predict_layers (`int`, *optional*, defaults to 1):
|
30 |
+
Number of nextn predict layers in the DeepSeekV3 Model.
|
31 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
32 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
33 |
+
n_shared_experts (`int`, *optional*, defaults to None):
|
34 |
+
Number of shared experts, None means dense model.
|
35 |
+
n_routed_experts (`int`, *optional*, defaults to None):
|
36 |
+
Number of routed experts, None means dense model.
|
37 |
+
routed_scaling_factor (`float`, *optional*, defaults to 1.0):
|
38 |
+
Scaling factor or routed experts.
|
39 |
+
topk_method (`str`, *optional*, defaults to `gready`):
|
40 |
+
Topk method used in routed gate.
|
41 |
+
n_group (`int`, *optional*, defaults to None):
|
42 |
+
Number of groups for routed experts.
|
43 |
+
topk_group (`int`, *optional*, defaults to None):
|
44 |
+
Number of selected groups for each token(for each token, ensuring the selected experts is only within `topk_group` groups).
|
45 |
+
num_experts_per_tok (`int`, *optional*, defaults to None):
|
46 |
+
Number of selected experts, None means dense model.
|
47 |
+
moe_layer_freq (`int`, *optional*, defaults to 1):
|
48 |
+
The frequency of the MoE layer: one expert layer for every `moe_layer_freq - 1` dense layers.
|
49 |
+
first_k_dense_replace (`int`, *optional*, defaults to 0):
|
50 |
+
Number of dense layers in shallow layers(embed->dense->dense->...->dense->moe->moe...->lm_head).
|
51 |
+
\--k dense layers--/
|
52 |
+
norm_topk_prob (`bool`, *optional*, defaults to False):
|
53 |
+
Whether to normalize the weights of the routed experts.
|
54 |
+
scoring_func (`str`, *optional*, defaults to 'softmax'):
|
55 |
+
Method of computing expert weights.
|
56 |
+
aux_loss_alpha (`float`, *optional*, defaults to 0.001):
|
57 |
+
Auxiliary loss weight coefficient.
|
58 |
+
seq_aux = (`bool`, *optional*, defaults to True):
|
59 |
+
Whether to compute the auxiliary loss for each individual sample.
|
60 |
+
num_key_value_heads (`int`, *optional*):
|
61 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
62 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
63 |
+
`num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
64 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
65 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
66 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
67 |
+
`num_attention_heads`.
|
68 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
69 |
+
The non-linear activation function (function or string) in the decoder.
|
70 |
+
max_position_embeddings (`int`, *optional*, defaults to 2048):
|
71 |
+
The maximum sequence length that this model might ever be used with.
|
72 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
73 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
74 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-06):
|
75 |
+
The epsilon used by the rms normalization layers.
|
76 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
77 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
78 |
+
relevant if `config.is_decoder=True`.
|
79 |
+
pad_token_id (`int`, *optional*):
|
80 |
+
Padding token id.
|
81 |
+
bos_token_id (`int`, *optional*, defaults to 1):
|
82 |
+
Beginning of stream token id.
|
83 |
+
eos_token_id (`int`, *optional*, defaults to 2):
|
84 |
+
End of stream token id.
|
85 |
+
pretraining_tp (`int`, *optional*, defaults to 1):
|
86 |
+
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
|
87 |
+
document](https://huggingface.co/docs/transformers/parallelism) to understand more about it. This value is
|
88 |
+
necessary to ensure exact reproducibility of the pretraining results. Please refer to [this
|
89 |
+
issue](https://github.com/pytorch/pytorch/issues/76232).
|
90 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
91 |
+
Whether to tie weight embeddings
|
92 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
93 |
+
The base period of the RoPE embeddings.
|
94 |
+
rope_scaling (`Dict`, *optional*):
|
95 |
+
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
|
96 |
+
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
|
97 |
+
`{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
|
98 |
+
`max_position_embeddings` to the expected new maximum.
|
99 |
+
attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
|
100 |
+
Whether to use a bias in the query, key, value and output projection layers during self-attention.
|
101 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
102 |
+
The dropout ratio for the attention probabilities.
|
103 |
+
|
104 |
+
```python
|
105 |
+
>>> from transformers import DeepseekV3Model, DeepseekV3Config
|
106 |
+
|
107 |
+
>>> # Initializing a Deepseek-V3 style configuration
|
108 |
+
>>> configuration = DeepseekV3Config()
|
109 |
+
|
110 |
+
>>> # Accessing the model configuration
|
111 |
+
>>> configuration = model.config
|
112 |
+
```"""
|
113 |
+
|
114 |
+
model_type = "deepseek_v3"
|
115 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
116 |
+
|
117 |
+
def __init__(
|
118 |
+
self,
|
119 |
+
vocab_size=129280,
|
120 |
+
hidden_size=7168,
|
121 |
+
intermediate_size=18432,
|
122 |
+
moe_intermediate_size = 2048,
|
123 |
+
num_hidden_layers=61,
|
124 |
+
num_nextn_predict_layers=1,
|
125 |
+
num_attention_heads=128,
|
126 |
+
num_key_value_heads=128,
|
127 |
+
n_shared_experts = 1,
|
128 |
+
n_routed_experts = 256,
|
129 |
+
ep_size = 1,
|
130 |
+
routed_scaling_factor = 2.5,
|
131 |
+
kv_lora_rank = 512,
|
132 |
+
q_lora_rank = 1536,
|
133 |
+
qk_rope_head_dim = 64,
|
134 |
+
v_head_dim = 128,
|
135 |
+
qk_nope_head_dim = 128,
|
136 |
+
topk_method = 'noaux_tc',
|
137 |
+
n_group = 8,
|
138 |
+
topk_group = 4,
|
139 |
+
num_experts_per_tok = 8,
|
140 |
+
moe_layer_freq = 1,
|
141 |
+
first_k_dense_replace = 3,
|
142 |
+
norm_topk_prob = True,
|
143 |
+
scoring_func = 'sigmoid',
|
144 |
+
aux_loss_alpha = 0.001,
|
145 |
+
seq_aux = True,
|
146 |
+
hidden_act="silu",
|
147 |
+
max_position_embeddings=4096,
|
148 |
+
initializer_range=0.02,
|
149 |
+
rms_norm_eps=1e-6,
|
150 |
+
use_cache=True,
|
151 |
+
pad_token_id=None,
|
152 |
+
bos_token_id=0,
|
153 |
+
eos_token_id=1,
|
154 |
+
pretraining_tp=1,
|
155 |
+
tie_word_embeddings=False,
|
156 |
+
rope_theta=10000.0,
|
157 |
+
rope_scaling=None,
|
158 |
+
attention_bias=False,
|
159 |
+
attention_dropout=0.0,
|
160 |
+
**kwargs,
|
161 |
+
):
|
162 |
+
self.vocab_size = vocab_size
|
163 |
+
self.max_position_embeddings = max_position_embeddings
|
164 |
+
self.hidden_size = hidden_size
|
165 |
+
self.intermediate_size = intermediate_size
|
166 |
+
self.moe_intermediate_size = moe_intermediate_size
|
167 |
+
self.num_hidden_layers = num_hidden_layers
|
168 |
+
self.num_nextn_predict_layers = num_nextn_predict_layers
|
169 |
+
self.num_attention_heads = num_attention_heads
|
170 |
+
self.n_shared_experts = n_shared_experts
|
171 |
+
self.n_routed_experts = n_routed_experts
|
172 |
+
self.ep_size = ep_size
|
173 |
+
self.routed_scaling_factor = routed_scaling_factor
|
174 |
+
self.kv_lora_rank = kv_lora_rank
|
175 |
+
self.q_lora_rank = q_lora_rank
|
176 |
+
self.qk_rope_head_dim = qk_rope_head_dim
|
177 |
+
self.v_head_dim = v_head_dim
|
178 |
+
self.qk_nope_head_dim = qk_nope_head_dim
|
179 |
+
self.topk_method = topk_method
|
180 |
+
self.n_group = n_group
|
181 |
+
self.topk_group = topk_group
|
182 |
+
self.num_experts_per_tok = num_experts_per_tok
|
183 |
+
self.moe_layer_freq = moe_layer_freq
|
184 |
+
self.first_k_dense_replace = first_k_dense_replace
|
185 |
+
self.norm_topk_prob = norm_topk_prob
|
186 |
+
self.scoring_func = scoring_func
|
187 |
+
self.aux_loss_alpha = aux_loss_alpha
|
188 |
+
self.seq_aux = seq_aux
|
189 |
+
# for backward compatibility
|
190 |
+
if num_key_value_heads is None:
|
191 |
+
num_key_value_heads = num_attention_heads
|
192 |
+
|
193 |
+
self.num_key_value_heads = num_key_value_heads
|
194 |
+
self.hidden_act = hidden_act
|
195 |
+
self.initializer_range = initializer_range
|
196 |
+
self.rms_norm_eps = rms_norm_eps
|
197 |
+
self.pretraining_tp = pretraining_tp
|
198 |
+
self.use_cache = use_cache
|
199 |
+
self.rope_theta = rope_theta
|
200 |
+
self.rope_scaling = rope_scaling
|
201 |
+
self.attention_bias = attention_bias
|
202 |
+
self.attention_dropout = attention_dropout
|
203 |
+
|
204 |
+
super().__init__(
|
205 |
+
pad_token_id=pad_token_id,
|
206 |
+
bos_token_id=bos_token_id,
|
207 |
+
eos_token_id=eos_token_id,
|
208 |
+
tie_word_embeddings=tie_word_embeddings,
|
209 |
+
**kwargs,
|
210 |
+
)
|
generation_config.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 0,
|
4 |
+
"do_sample": true,
|
5 |
+
"eos_token_id": 1,
|
6 |
+
"temperature": 0.6,
|
7 |
+
"top_p": 0.95,
|
8 |
+
"transformers_version": "4.51.3"
|
9 |
+
}
|
model-00001-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:63ca4d560e0faef0df165cbe23501a40af48b3e6e0af1ef71e9c0e681ff46d40
|
3 |
+
size 4995884768
|
model-00002-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f4ca2ac91eadcb0941d6feb5d25100c5dccd0ad78a872e0173900adff2de0d36
|
3 |
+
size 4995052496
|
model-00003-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:48fe7856e8527ba5efd6c086aa0d15aefa7e0b4ac37785cedf72f6512db1da57
|
3 |
+
size 4999071368
|
model-00004-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e201d7a764d220b10fabaf9f3af1a69b365222a7b2b426aa58ef0a4ec69815cf
|
3 |
+
size 4994943096
|
model-00005-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d95eecd8de3bd59a037d882568bd947b10159fc4ef23dec19cb0625af0a60ad5
|
3 |
+
size 4994943232
|
model-00006-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bc68ae966c0d2f2cd737e24dddb2bf17bac5e8727295ca25f25989bd55123d2a
|
3 |
+
size 4994943456
|
model-00007-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:958675a01ba08cf5231a886ffa1b40d12105b13df6ebedebf58bcd62fb015963
|
3 |
+
size 4999180624
|
model-00008-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1e679ba36e007c55aa86f671f3e5758357c17a84a5b04600eeb035daa12be832
|
3 |
+
size 4994943096
|
model-00009-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6c5e2ba4d9c18572331e31e3f09f24aeebf806434db2a8ce890643248cf3a91f
|
3 |
+
size 4994943096
|
model-00010-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0fecc475b57c858f8be5a82e7055572f2fe1db646bb3b8bee892c0822e8f2cca
|
3 |
+
size 4994943720
|
model-00011-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2a9df0953d2a655283ac4321a52cff7ba8e6e7bfcce3fd4e49e071154baef4ca
|
3 |
+
size 4916044152
|
model-00012-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a0b324256e9900992b5718dbc016fac1c9df249cb68f5a46aec47d6d47ba805f
|
3 |
+
size 5000091936
|
model-00013-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:da266c07535de2820652b58a52a2f556b9cfd00058572243044c7b6632726a89
|
3 |
+
size 4994944296
|
model-00014-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:751e8bed8d630c8c46d1fa7466c34b8703f93d57acab8ca76f32d33e447d6743
|
3 |
+
size 4994944392
|
model-00015-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e20545f0a96cf537b1a222a8344c74f750ac1605efcfcc3aed39fc274d3d5d51
|
3 |
+
size 4994944648
|
model-00016-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cc41909924a6d1866940342fe060909585c9d4e1d603d877ef45b3af9f6bfc70
|
3 |
+
size 4999181952
|
model-00017-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:df9d63f028e6c4980df72e791eaddf29f3e492fed579fab7c4cea37965a64895
|
3 |
+
size 4994944288
|
model-00018-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8b4bd5df0ccf2a34f10b3a8b6e323eb3e84f3443f830ddbc4de58c04b72d9e02
|
3 |
+
size 4994944296
|
model-00019-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:918f36bdd51fdfb7545866ef568bb22f6806b7303fa4dea0b90b93e5020ab801
|
3 |
+
size 4994944536
|
model-00020-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b4a9b5ce2f5051eb15612a0bee4d7af03cd3561112bee2b99f677c51b47dd84f
|
3 |
+
size 4767862480
|
model-00021-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f2539882f19a491fbb8d35430a97b56519de350ee32a8db415321ed8848e7255
|
3 |
+
size 5000091936
|
model-00022-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:332bd162e119c8d2976fb6f8d860e11b905bfcfdf269896e8866b57fba062769
|
3 |
+
size 4994944296
|
model-00023-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1a84c3bf5b86d5d1ab112c5391293426f65ccdede9d81d89e94b752cb6bc7c36
|
3 |
+
size 4994944392
|
model-00024-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ea4155bff895f55d944cc2932fe60bbe5d0063a07563bbacddb18c454fbfed6f
|
3 |
+
size 4994944648
|
model-00025-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:494330e312c06cc83970f600dd614afb18c31bbea932defe0418a01dd9af3fcd
|
3 |
+
size 4999181952
|
model-00026-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:08fef0bf35c5a07ba9be720f1a769c84e374877edf307883c27a164e9ec6127c
|
3 |
+
size 4994944288
|
model-00027-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:434d8f6357828f5b90c50b39e61f66e71664217151f17bce8d72330635c384bd
|
3 |
+
size 4994944296
|
model-00028-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ab90d0ee909ea8ae7764c2a4dd35d707c9ec1e00e017fc3f393f90d7c2328b31
|
3 |
+
size 4994944536
|
model-00029-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7103c2ec83a55fda632765a375cd5c6c0a92891b6b4d47f45f5573e61a7d5380
|
3 |
+
size 4767862480
|
model-00030-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:583998027f5955b5b9fd4f056e59940fd63e67fb9f8fb11f60234e6e012a4a2d
|
3 |
+
size 5000091936
|
model-00031-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0e2ce43497a1405b8292442d123a6bc889127cd89d1932975796b9de2582cdef
|
3 |
+
size 4994944296
|
model-00032-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7c6d7badd691827eb515b22ad8eb16fe3935f63baae82b18c8d749bfa6768a29
|
3 |
+
size 4994944392
|
model-00033-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:da32ce9859d1d8bb82b060a775578f1ade1efdc12b293391e90d9787037e56b6
|
3 |
+
size 4994944648
|
model-00034-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:49150c80ca6d531a51bbb6c0053e932cfb51c2a4a14d1e2b375eadd71d9f82e3
|
3 |
+
size 4999181952
|
model-00035-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5152ae536963a9eb5c270becfd78c8c8157b5cc703a9fa1410af230243a9e328
|
3 |
+
size 4994944288
|
model-00036-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:78c64237fecda8e591c2fc01c082dd92dc64d2bda7c5f5d3eea270322a875ba2
|
3 |
+
size 4994944296
|
model-00037-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a3853e835dc9a6493a5c9a01f06d2a926afb38cc923b4f140de6d01c264f0728
|
3 |
+
size 4994944536
|
model-00038-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:98264e9c269c579ba6ab5839327942158eb4cd1f6417db3093e5238e92a20c99
|
3 |
+
size 4767862480
|
model-00039-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9f9739f520fb31bf6f7f3474495e1bdca2bb27571206c49fe40837ac86ecbc12
|
3 |
+
size 5000091936
|
model-00040-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7a63745e6393554891a5ddcecf73814fb785b4baff30c270224cbc3b083a423c
|
3 |
+
size 4994944296
|
model-00041-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4c437acf47efd1616a4685feaafba61d9eeb0afa539967db98f497ca42e7620c
|
3 |
+
size 4994944392
|
model-00042-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dca3b4c55b4b85f9ca7370c8b678d72a0eacb320d3656af13f56a40b3b44b9cd
|
3 |
+
size 4994944648
|
model-00043-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ec53416f5c28567f50acba9ec99ecdc9c36efa67bdc47f66450b52e61e2570ae
|
3 |
+
size 4999181952
|
model-00044-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:042dbfb110634ef17aacad948f22fac2da1d9b6028e2a26e9228114629053156
|
3 |
+
size 4994944288
|
model-00045-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4cbaa9c03aa658d42d25a2495756b78786fd789b41a3288d5a06a96bb02cc202
|
3 |
+
size 4994944296
|
model-00046-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f60ba5a10e0ec88dbf62e0a27a1f0316939c655bb86718c958d65e229c7cced3
|
3 |
+
size 4994944536
|
model-00047-of-00076.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e7496e5a1f159705c405a5ddee082dbbbd99485138c0d44d3389d58455b28d32
|
3 |
+
size 4767862480
|