mattbcam commited on
Commit
83cc450
·
verified ·
1 Parent(s): d317755

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. README.md +36 -0
  2. chat_template.jinja +3 -0
  3. config.json +67 -0
  4. configuration_deepseek.py +199 -0
  5. generation_config.json +9 -0
  6. model-00001-of-00234.safetensors +3 -0
  7. model-00007-of-00234.safetensors +3 -0
  8. model-00008-of-00234.safetensors +3 -0
  9. model-00015-of-00234.safetensors +3 -0
  10. model-00028-of-00234.safetensors +3 -0
  11. model-00035-of-00234.safetensors +3 -0
  12. model-00039-of-00234.safetensors +3 -0
  13. model-00043-of-00234.safetensors +3 -0
  14. model-00049-of-00234.safetensors +3 -0
  15. model-00051-of-00234.safetensors +3 -0
  16. model-00052-of-00234.safetensors +3 -0
  17. model-00069-of-00234.safetensors +3 -0
  18. model-00071-of-00234.safetensors +3 -0
  19. model-00078-of-00234.safetensors +3 -0
  20. model-00084-of-00234.safetensors +3 -0
  21. model-00087-of-00234.safetensors +3 -0
  22. model-00088-of-00234.safetensors +3 -0
  23. model-00109-of-00234.safetensors +3 -0
  24. model-00111-of-00234.safetensors +3 -0
  25. model-00114-of-00234.safetensors +3 -0
  26. model-00118-of-00234.safetensors +3 -0
  27. model-00123-of-00234.safetensors +3 -0
  28. model-00125-of-00234.safetensors +3 -0
  29. model-00129-of-00234.safetensors +3 -0
  30. model-00131-of-00234.safetensors +3 -0
  31. model-00148-of-00234.safetensors +3 -0
  32. model-00155-of-00234.safetensors +3 -0
  33. model-00159-of-00234.safetensors +3 -0
  34. model-00167-of-00234.safetensors +3 -0
  35. model-00168-of-00234.safetensors +3 -0
  36. model-00183-of-00234.safetensors +3 -0
  37. model-00191-of-00234.safetensors +3 -0
  38. model-00198-of-00234.safetensors +3 -0
  39. model-00200-of-00234.safetensors +3 -0
  40. model-00203-of-00234.safetensors +3 -0
  41. model-00209-of-00234.safetensors +3 -0
  42. model-00223-of-00234.safetensors +3 -0
  43. model-00231-of-00234.safetensors +3 -0
  44. model-00232-of-00234.safetensors +3 -0
  45. model-00234-of-00234.safetensors +3 -0
  46. model.safetensors.index.json +1033 -0
  47. modeling_deepseek.py +1848 -0
  48. special_tokens_map.json +23 -0
  49. tokenizer.json +0 -0
  50. tokenizer_config.json +0 -0
README.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: mlx
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - mlx
7
+ base_model: deepseek-ai/DeepSeek-V3.1
8
+ ---
9
+
10
+ # mlx-community/DeepSeek-V3.1-8bit
11
+
12
+ This model [mlx-community/DeepSeek-V3.1-8bit](https://huggingface.co/mlx-community/DeepSeek-V3.1-8bit) was
13
+ converted to MLX format from [deepseek-ai/DeepSeek-V3.1](https://huggingface.co/deepseek-ai/DeepSeek-V3.1)
14
+ using mlx-lm version **0.26.3**.
15
+
16
+ ## Use with mlx
17
+
18
+ ```bash
19
+ pip install mlx-lm
20
+ ```
21
+
22
+ ```python
23
+ from mlx_lm import load, generate
24
+
25
+ model, tokenizer = load("mlx-community/DeepSeek-V3.1-8bit")
26
+
27
+ prompt = "hello"
28
+
29
+ if tokenizer.chat_template is not None:
30
+ messages = [{"role": "user", "content": prompt}]
31
+ prompt = tokenizer.apply_chat_template(
32
+ messages, add_generation_prompt=True
33
+ )
34
+
35
+ response = generate(model, tokenizer, prompt=prompt, verbose=True)
36
+ ```
chat_template.jinja ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% if not thinking is defined %}{% set thinking = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, system_prompt='', is_first_sp=true, is_last_user=false) %}{%- for message in messages %}{%- if message['role'] == 'system' %}{%- if ns.is_first_sp %}{% set ns.system_prompt = ns.system_prompt + message['content'] %}{% set ns.is_first_sp = false %}{%- else %}{% set ns.system_prompt = ns.system_prompt + '
2
+
3
+ ' + message['content'] %}{%- endif %}{%- endif %}{%- endfor %}{{ bos_token }}{{ ns.system_prompt }}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{%- set ns.is_first = false -%}{%- set ns.is_last_user = true -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['tool_calls'] is defined and message['tool_calls'] is not none %}{%- if ns.is_last_user %}{{'<|Assistant|></think>'}}{%- endif %}{%- set ns.is_last_user = false -%}{%- set ns.is_first = false %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls'] %}{%- if not ns.is_first %}{%- if message['content'] is none %}{{'<|tool▁calls▁begin|><|tool▁call▁begin|>'+ tool['function']['name'] + '<|tool▁sep|>' + tool['function']['arguments'] + '<|tool▁call▁end|>'}}{%- else %}{{message['content'] + '<|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['function']['name'] + '<|tool▁sep|>' + tool['function']['arguments'] + '<|tool▁call▁end|>'}}{%- endif %}{%- set ns.is_first = true -%}{%- else %}{{'<|tool▁call▁begin|>'+ tool['function']['name'] + '<|tool▁sep|>' + tool['function']['arguments'] + '<|tool▁call▁end|>'}}{%- endif %}{%- endfor %}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- if message['role'] == 'assistant' and (message['tool_calls'] is not defined or message['tool_calls'] is none) %}{%- if ns.is_last_user %}{{'<|Assistant|>'}}{%- if message['prefix'] is defined and message['prefix'] and thinking %}{{'<think>'}} {%- else %}{{'</think>'}}{%- endif %}{%- endif %}{%- set ns.is_last_user = false -%}{%- if ns.is_tool %}{{message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{%- set content = message['content'] -%}{%- if '</think>' in content %}{%- set content = content.split('</think>', 1)[1] -%}{%- endif %}{{content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_last_user = false -%}{%- set ns.is_tool = true -%}{{'<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endfor -%}{%- if add_generation_prompt and ns.is_last_user and not ns.is_tool %}{{'<|Assistant|>'}}{%- if not thinking %}{{'</think>'}}{%- else %}{{'<think>'}}{%- endif %}{% endif %}
config.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "bos_token_id": 0,
13
+ "eos_token_id": 1,
14
+ "ep_size": 1,
15
+ "first_k_dense_replace": 3,
16
+ "hidden_act": "silu",
17
+ "hidden_size": 7168,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 18432,
20
+ "kv_lora_rank": 512,
21
+ "max_position_embeddings": 163840,
22
+ "model_type": "deepseek_v3",
23
+ "moe_intermediate_size": 2048,
24
+ "moe_layer_freq": 1,
25
+ "n_group": 8,
26
+ "n_routed_experts": 256,
27
+ "n_shared_experts": 1,
28
+ "norm_topk_prob": true,
29
+ "num_attention_heads": 128,
30
+ "num_experts_per_tok": 8,
31
+ "num_hidden_layers": 61,
32
+ "num_key_value_heads": 128,
33
+ "num_nextn_predict_layers": 1,
34
+ "q_lora_rank": 1536,
35
+ "qk_nope_head_dim": 128,
36
+ "qk_rope_head_dim": 64,
37
+ "quantization_config": {
38
+ "activation_scheme": "dynamic",
39
+ "fmt": "e4m3",
40
+ "quant_method": "fp8",
41
+ "weight_block_size": [
42
+ 128,
43
+ 128
44
+ ]
45
+ },
46
+ "rms_norm_eps": 1e-06,
47
+ "rope_scaling": {
48
+ "beta_fast": 32,
49
+ "beta_slow": 1,
50
+ "factor": 40,
51
+ "mscale": 1.0,
52
+ "mscale_all_dim": 1.0,
53
+ "original_max_position_embeddings": 4096,
54
+ "type": "yarn"
55
+ },
56
+ "rope_theta": 10000,
57
+ "routed_scaling_factor": 2.5,
58
+ "scoring_func": "sigmoid",
59
+ "tie_word_embeddings": false,
60
+ "topk_group": 4,
61
+ "topk_method": "noaux_tc",
62
+ "torch_dtype": "bfloat16",
63
+ "transformers_version": "4.44.2",
64
+ "use_cache": true,
65
+ "v_head_dim": 128,
66
+ "vocab_size": 129280
67
+ }
configuration_deepseek.py ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ tie_word_embeddings (`bool`, *optional*, defaults to `False`):
86
+ Whether to tie weight embeddings
87
+ rope_theta (`float`, *optional*, defaults to 10000.0):
88
+ The base period of the RoPE embeddings.
89
+ rope_scaling (`Dict`, *optional*):
90
+ Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
91
+ strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
92
+ `{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
93
+ `max_position_embeddings` to the expected new maximum.
94
+ attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
95
+ Whether to use a bias in the query, key, value and output projection layers during self-attention.
96
+ attention_dropout (`float`, *optional*, defaults to 0.0):
97
+ The dropout ratio for the attention probabilities.
98
+
99
+ ```python
100
+ >>> from transformers import DeepseekV3Model, DeepseekV3Config
101
+
102
+ >>> # Initializing a Deepseek-V3 style configuration
103
+ >>> configuration = DeepseekV3Config()
104
+
105
+ >>> # Accessing the model configuration
106
+ >>> configuration = model.config
107
+ ```"""
108
+
109
+ model_type = "deepseek_v3"
110
+ keys_to_ignore_at_inference = ["past_key_values"]
111
+
112
+ def __init__(
113
+ self,
114
+ vocab_size=129280,
115
+ hidden_size=7168,
116
+ intermediate_size=18432,
117
+ moe_intermediate_size = 2048,
118
+ num_hidden_layers=61,
119
+ num_nextn_predict_layers=1,
120
+ num_attention_heads=128,
121
+ num_key_value_heads=128,
122
+ n_shared_experts = 1,
123
+ n_routed_experts = 256,
124
+ ep_size = 1,
125
+ routed_scaling_factor = 2.5,
126
+ kv_lora_rank = 512,
127
+ q_lora_rank = 1536,
128
+ qk_rope_head_dim = 64,
129
+ v_head_dim = 128,
130
+ qk_nope_head_dim = 128,
131
+ topk_method = 'noaux_tc',
132
+ n_group = 8,
133
+ topk_group = 4,
134
+ num_experts_per_tok = 8,
135
+ moe_layer_freq = 1,
136
+ first_k_dense_replace = 3,
137
+ norm_topk_prob = True,
138
+ scoring_func = 'sigmoid',
139
+ hidden_act="silu",
140
+ max_position_embeddings=4096,
141
+ initializer_range=0.02,
142
+ rms_norm_eps=1e-6,
143
+ use_cache=True,
144
+ pad_token_id=None,
145
+ bos_token_id=0,
146
+ eos_token_id=1,
147
+ tie_word_embeddings=False,
148
+ rope_theta=10000.0,
149
+ rope_scaling=None,
150
+ attention_bias=False,
151
+ attention_dropout=0.0,
152
+ **kwargs,
153
+ ):
154
+ self.vocab_size = vocab_size
155
+ self.max_position_embeddings = max_position_embeddings
156
+ self.hidden_size = hidden_size
157
+ self.intermediate_size = intermediate_size
158
+ self.moe_intermediate_size = moe_intermediate_size
159
+ self.num_hidden_layers = num_hidden_layers
160
+ self.num_nextn_predict_layers = num_nextn_predict_layers
161
+ self.num_attention_heads = num_attention_heads
162
+ self.n_shared_experts = n_shared_experts
163
+ self.n_routed_experts = n_routed_experts
164
+ self.ep_size = ep_size
165
+ self.routed_scaling_factor = routed_scaling_factor
166
+ self.kv_lora_rank = kv_lora_rank
167
+ self.q_lora_rank = q_lora_rank
168
+ self.qk_rope_head_dim = qk_rope_head_dim
169
+ self.v_head_dim = v_head_dim
170
+ self.qk_nope_head_dim = qk_nope_head_dim
171
+ self.topk_method = topk_method
172
+ self.n_group = n_group
173
+ self.topk_group = topk_group
174
+ self.num_experts_per_tok = num_experts_per_tok
175
+ self.moe_layer_freq = moe_layer_freq
176
+ self.first_k_dense_replace = first_k_dense_replace
177
+ self.norm_topk_prob = norm_topk_prob
178
+ self.scoring_func = scoring_func
179
+ # for backward compatibility
180
+ if num_key_value_heads is None:
181
+ num_key_value_heads = num_attention_heads
182
+
183
+ self.num_key_value_heads = num_key_value_heads
184
+ self.hidden_act = hidden_act
185
+ self.initializer_range = initializer_range
186
+ self.rms_norm_eps = rms_norm_eps
187
+ self.use_cache = use_cache
188
+ self.rope_theta = rope_theta
189
+ self.rope_scaling = rope_scaling
190
+ self.attention_bias = attention_bias
191
+ self.attention_dropout = attention_dropout
192
+
193
+ super().__init__(
194
+ pad_token_id=pad_token_id,
195
+ bos_token_id=bos_token_id,
196
+ eos_token_id=eos_token_id,
197
+ tie_word_embeddings=tie_word_embeddings,
198
+ **kwargs,
199
+ )
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 1,
5
+ "do_sample": true,
6
+ "temperature": 0.6,
7
+ "top_p": 0.95,
8
+ "transformers_version": "4.46.3"
9
+ }
model-00001-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6dde7d5fdff0729905df22502ed704f34df1dffa173b6d8adea742de94ebc76f
3
+ size 5354262805
model-00007-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03849316a0373aede154dd904692cc9937a7268ba9f828c90d1a144cca36e87d
3
+ size 7516192929
model-00008-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2c2bfce57dc0b5c5e5cd4533707fa8a7d82ef04bcb1e6c686bb9abe8267eb2f
3
+ size 7516192927
model-00015-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98a3f20224a45ed2b961f48a44804432467a11ee7a6ff6b42ee15744f1f2196d
3
+ size 7516192929
model-00028-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53a87fcc281b171b5d5b808d0403f76400326e8fbcff1a169c7a6139ec5c32e5
3
+ size 7516192927
model-00035-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:521f76a1f49f7815ebac308bcae648fbf2f417150410f90da78e84442db4993c
3
+ size 7516192930
model-00039-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6202eec911ee1aa03c986dcf01e927347d83add3cb6d8c27c5c11c78fc42233
3
+ size 7516192930
model-00043-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca1879d9d3ce33d261913f8140504426285c97512eaeeeadc82d88f972496cc9
3
+ size 7516192930
model-00049-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96debcc258819afda8c95d12043f05ede847b55c74cf7b70fc52e89d70710966
3
+ size 7516192930
model-00051-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:208ebf77dfa2ac25d8340c0511fc22954aca9ee60a040a0712136a6d9c3b99f3
3
+ size 7516192930
model-00052-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:990ba6922f07a687c1f800d108ab6acf5310f1b1686ccf22bb7db71defbb2b4a
3
+ size 7516192928
model-00069-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e1b96667ae5d8bf04ee7f5fb3ef18a5688accfbf39ca94af59184ff432c6514
3
+ size 7516192930
model-00071-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d3687810b7d05cecda83cf06cd70c87f463e8f0ab08095780dc35072c2e84192
3
+ size 7516192930
model-00078-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92e1d0abda36d70a3bdad27b553c467c3392480b0b413ed87bbff97a2adb8b25
3
+ size 465996423
model-00084-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c34bb2e5f7ec9c60f6920c6aa3c842fe4b88fb57b5529b3796a4cee21c5318f
3
+ size 7516192928
model-00087-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de0f2799b2046ada76562840ce0ae43bcc663795d79749912f8ef58d9181d40b
3
+ size 7516192930
model-00088-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:652bff8bf5ff7c7ba2f626d75c8ca0c256e5168329d48a1d42de16ab6fdd6bec
3
+ size 7516192928
model-00109-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd6e3d0f4269f36b92650481c194fa772189b4593607ac3d49f1af17f8040f14
3
+ size 7516192930
model-00111-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5daa56c0716c0b1eabf1070fb20cd89808f3d96e4ae06b6ec41b81fccfaec34c
3
+ size 7516192930
model-00114-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ff630be3cdbf7a0b14852ee2380f3869920b4fc79cf2f5fc0b9690124fd338a
3
+ size 465996457
model-00118-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e7bf38fa27aa3ea5d51ba8621fdc8a938e524ae0e790b2d92e0838d62f4c846
3
+ size 465996457
model-00123-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf6a47f98f06d386588f20d4916d40cadcc58cef90c95a932e9162bd3845b77b
3
+ size 7516192930
model-00125-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16041ce4c28feb9dd684b9b8e9eb2c0756ca1d733bcd4de3f4c3d57ee9c3c01a
3
+ size 7516192930
model-00129-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41336668cfaac811904c25fc53c2d37b54acea8b071b1e4a668714e511b57cee
3
+ size 7516192930
model-00131-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da41676033812779094c8bca6c6f68ef9e0b234625c92c3cc3d81ea9ea53c881
3
+ size 7516192930
model-00148-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cd95b1ea57162b1bcf6847471af5902ba5e704cca1ce155d92e96614364aa03
3
+ size 7516192928
model-00155-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1bbc8612b762f4fb201fff0cb339a5aa485fbcdc0b79d76100e8de703ea3eec
3
+ size 7516192930
model-00159-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2680a2882cd1c446ad6dcbc4b48663d01c7ef3e9b6afdcfd49b617367fd93475
3
+ size 7516192930
model-00167-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed60734a3d2fcf05947c7b64d307afee0271e9748b1f2ff402f9b43be72db622
3
+ size 7516192930
model-00168-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33f457ef0238733aa4a3d1c59fb67a376f8e3cde7e1aa8ed1a1c6c435749ad49
3
+ size 7516192928
model-00183-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69e978796595414be940d18584968ab029c78a487121af239758b00f72af9f84
3
+ size 7516192930
model-00191-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e81ea51ff2d49f40732a7e4e7480909f0a772b599759780dadb42c497fd2bcec
3
+ size 7516192930
model-00198-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85b7b49fe99270b62e157d1e787bac01632d8369c9939755ef5021ee89f3fc02
3
+ size 465996449
model-00200-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fa1b2644ab670c6a172af6b3432740e33995b68553aae3d0aabc4129cc2f115
3
+ size 7516192928
model-00203-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db2545a416480c18cb36da89aed16dd68df13fb6a297e62230ad6c1cd551f95e
3
+ size 7516192930
model-00209-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a78455f538c9c239e01ad2cdbbdc95df1af184b697de63be7566e03533ed9fec
3
+ size 7516192930
model-00223-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dccbd2e20f8ba4c255906fe7e4c3085e67a16966163a55ae4ffe6a38d3b5267
3
+ size 7516192930
model-00231-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d791f0cc69331c02c05a4983440c76b82e69a19717e2ebb63e7c96484779552a
3
+ size 7516192930
model-00232-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10a2884769880b9dc847b817fb05f54988d58cd2fb90fa3bfc0b7292e9bcd4d8
3
+ size 7516192928
model-00234-of-00234.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5111b60328be864824d73260cd4658d5db1eea0a490979b4c21f857ff983c632
3
+ size 1945153580
model.safetensors.index.json ADDED
@@ -0,0 +1,1033 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 1342052868096,
4
+ "total_parameters": 671026419200
5
+ },
6
+ "weight_map": {
7
+ "lm_head.weight": "model-00234-of-00234.safetensors",
8
+ "model.embed_tokens.weight": "model-00001-of-00234.safetensors",
9
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00234.safetensors",
10
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00234.safetensors",
11
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00234.safetensors",
12
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00234.safetensors",
13
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00234.safetensors",
14
+ "model.layers.0.self_attn.kv_a_layernorm.weight": "model-00001-of-00234.safetensors",
15
+ "model.layers.0.self_attn.kv_a_proj_with_mqa.weight": "model-00001-of-00234.safetensors",
16
+ "model.layers.0.self_attn.kv_b_proj.weight": "model-00001-of-00234.safetensors",
17
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00234.safetensors",
18
+ "model.layers.0.self_attn.q_a_layernorm.weight": "model-00001-of-00234.safetensors",
19
+ "model.layers.0.self_attn.q_a_proj.weight": "model-00001-of-00234.safetensors",
20
+ "model.layers.0.self_attn.q_b_proj.weight": "model-00001-of-00234.safetensors",
21
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00234.safetensors",
22
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00234.safetensors",
23
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00234.safetensors",
24
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00234.safetensors",
25
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00234.safetensors",
26
+ "model.layers.1.self_attn.kv_a_layernorm.weight": "model-00001-of-00234.safetensors",
27
+ "model.layers.1.self_attn.kv_a_proj_with_mqa.weight": "model-00001-of-00234.safetensors",
28
+ "model.layers.1.self_attn.kv_b_proj.weight": "model-00001-of-00234.safetensors",
29
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00234.safetensors",
30
+ "model.layers.1.self_attn.q_a_layernorm.weight": "model-00001-of-00234.safetensors",
31
+ "model.layers.1.self_attn.q_a_proj.weight": "model-00001-of-00234.safetensors",
32
+ "model.layers.1.self_attn.q_b_proj.weight": "model-00001-of-00234.safetensors",
33
+ "model.layers.10.input_layernorm.weight": "model-00034-of-00234.safetensors",
34
+ "model.layers.10.mlp.gate.e_score_correction_bias": "model-00034-of-00234.safetensors",
35
+ "model.layers.10.mlp.gate.weight": "model-00034-of-00234.safetensors",
36
+ "model.layers.10.mlp.shared_experts.down_proj.weight": "model-00034-of-00234.safetensors",
37
+ "model.layers.10.mlp.shared_experts.gate_proj.weight": "model-00034-of-00234.safetensors",
38
+ "model.layers.10.mlp.shared_experts.up_proj.weight": "model-00034-of-00234.safetensors",
39
+ "model.layers.10.mlp.switch_mlp.down_proj.weight": "model-00033-of-00234.safetensors",
40
+ "model.layers.10.mlp.switch_mlp.gate_proj.weight": "model-00031-of-00234.safetensors",
41
+ "model.layers.10.mlp.switch_mlp.up_proj.weight": "model-00032-of-00234.safetensors",
42
+ "model.layers.10.post_attention_layernorm.weight": "model-00034-of-00234.safetensors",
43
+ "model.layers.10.self_attn.kv_a_layernorm.weight": "model-00030-of-00234.safetensors",
44
+ "model.layers.10.self_attn.kv_a_proj_with_mqa.weight": "model-00030-of-00234.safetensors",
45
+ "model.layers.10.self_attn.kv_b_proj.weight": "model-00030-of-00234.safetensors",
46
+ "model.layers.10.self_attn.o_proj.weight": "model-00030-of-00234.safetensors",
47
+ "model.layers.10.self_attn.q_a_layernorm.weight": "model-00030-of-00234.safetensors",
48
+ "model.layers.10.self_attn.q_a_proj.weight": "model-00030-of-00234.safetensors",
49
+ "model.layers.10.self_attn.q_b_proj.weight": "model-00030-of-00234.safetensors",
50
+ "model.layers.11.input_layernorm.weight": "model-00038-of-00234.safetensors",
51
+ "model.layers.11.mlp.gate.e_score_correction_bias": "model-00038-of-00234.safetensors",
52
+ "model.layers.11.mlp.gate.weight": "model-00038-of-00234.safetensors",
53
+ "model.layers.11.mlp.shared_experts.down_proj.weight": "model-00038-of-00234.safetensors",
54
+ "model.layers.11.mlp.shared_experts.gate_proj.weight": "model-00038-of-00234.safetensors",
55
+ "model.layers.11.mlp.shared_experts.up_proj.weight": "model-00038-of-00234.safetensors",
56
+ "model.layers.11.mlp.switch_mlp.down_proj.weight": "model-00037-of-00234.safetensors",
57
+ "model.layers.11.mlp.switch_mlp.gate_proj.weight": "model-00035-of-00234.safetensors",
58
+ "model.layers.11.mlp.switch_mlp.up_proj.weight": "model-00036-of-00234.safetensors",
59
+ "model.layers.11.post_attention_layernorm.weight": "model-00038-of-00234.safetensors",
60
+ "model.layers.11.self_attn.kv_a_layernorm.weight": "model-00034-of-00234.safetensors",
61
+ "model.layers.11.self_attn.kv_a_proj_with_mqa.weight": "model-00034-of-00234.safetensors",
62
+ "model.layers.11.self_attn.kv_b_proj.weight": "model-00034-of-00234.safetensors",
63
+ "model.layers.11.self_attn.o_proj.weight": "model-00034-of-00234.safetensors",
64
+ "model.layers.11.self_attn.q_a_layernorm.weight": "model-00034-of-00234.safetensors",
65
+ "model.layers.11.self_attn.q_a_proj.weight": "model-00034-of-00234.safetensors",
66
+ "model.layers.11.self_attn.q_b_proj.weight": "model-00034-of-00234.safetensors",
67
+ "model.layers.12.input_layernorm.weight": "model-00042-of-00234.safetensors",
68
+ "model.layers.12.mlp.gate.e_score_correction_bias": "model-00042-of-00234.safetensors",
69
+ "model.layers.12.mlp.gate.weight": "model-00042-of-00234.safetensors",
70
+ "model.layers.12.mlp.shared_experts.down_proj.weight": "model-00042-of-00234.safetensors",
71
+ "model.layers.12.mlp.shared_experts.gate_proj.weight": "model-00042-of-00234.safetensors",
72
+ "model.layers.12.mlp.shared_experts.up_proj.weight": "model-00042-of-00234.safetensors",
73
+ "model.layers.12.mlp.switch_mlp.down_proj.weight": "model-00041-of-00234.safetensors",
74
+ "model.layers.12.mlp.switch_mlp.gate_proj.weight": "model-00039-of-00234.safetensors",
75
+ "model.layers.12.mlp.switch_mlp.up_proj.weight": "model-00040-of-00234.safetensors",
76
+ "model.layers.12.post_attention_layernorm.weight": "model-00042-of-00234.safetensors",
77
+ "model.layers.12.self_attn.kv_a_layernorm.weight": "model-00038-of-00234.safetensors",
78
+ "model.layers.12.self_attn.kv_a_proj_with_mqa.weight": "model-00038-of-00234.safetensors",
79
+ "model.layers.12.self_attn.kv_b_proj.weight": "model-00038-of-00234.safetensors",
80
+ "model.layers.12.self_attn.o_proj.weight": "model-00038-of-00234.safetensors",
81
+ "model.layers.12.self_attn.q_a_layernorm.weight": "model-00038-of-00234.safetensors",
82
+ "model.layers.12.self_attn.q_a_proj.weight": "model-00038-of-00234.safetensors",
83
+ "model.layers.12.self_attn.q_b_proj.weight": "model-00038-of-00234.safetensors",
84
+ "model.layers.13.input_layernorm.weight": "model-00046-of-00234.safetensors",
85
+ "model.layers.13.mlp.gate.e_score_correction_bias": "model-00046-of-00234.safetensors",
86
+ "model.layers.13.mlp.gate.weight": "model-00046-of-00234.safetensors",
87
+ "model.layers.13.mlp.shared_experts.down_proj.weight": "model-00046-of-00234.safetensors",
88
+ "model.layers.13.mlp.shared_experts.gate_proj.weight": "model-00046-of-00234.safetensors",
89
+ "model.layers.13.mlp.shared_experts.up_proj.weight": "model-00046-of-00234.safetensors",
90
+ "model.layers.13.mlp.switch_mlp.down_proj.weight": "model-00045-of-00234.safetensors",
91
+ "model.layers.13.mlp.switch_mlp.gate_proj.weight": "model-00043-of-00234.safetensors",
92
+ "model.layers.13.mlp.switch_mlp.up_proj.weight": "model-00044-of-00234.safetensors",
93
+ "model.layers.13.post_attention_layernorm.weight": "model-00046-of-00234.safetensors",
94
+ "model.layers.13.self_attn.kv_a_layernorm.weight": "model-00042-of-00234.safetensors",
95
+ "model.layers.13.self_attn.kv_a_proj_with_mqa.weight": "model-00042-of-00234.safetensors",
96
+ "model.layers.13.self_attn.kv_b_proj.weight": "model-00042-of-00234.safetensors",
97
+ "model.layers.13.self_attn.o_proj.weight": "model-00042-of-00234.safetensors",
98
+ "model.layers.13.self_attn.q_a_layernorm.weight": "model-00042-of-00234.safetensors",
99
+ "model.layers.13.self_attn.q_a_proj.weight": "model-00042-of-00234.safetensors",
100
+ "model.layers.13.self_attn.q_b_proj.weight": "model-00042-of-00234.safetensors",
101
+ "model.layers.14.input_layernorm.weight": "model-00050-of-00234.safetensors",
102
+ "model.layers.14.mlp.gate.e_score_correction_bias": "model-00050-of-00234.safetensors",
103
+ "model.layers.14.mlp.gate.weight": "model-00050-of-00234.safetensors",
104
+ "model.layers.14.mlp.shared_experts.down_proj.weight": "model-00050-of-00234.safetensors",
105
+ "model.layers.14.mlp.shared_experts.gate_proj.weight": "model-00050-of-00234.safetensors",
106
+ "model.layers.14.mlp.shared_experts.up_proj.weight": "model-00050-of-00234.safetensors",
107
+ "model.layers.14.mlp.switch_mlp.down_proj.weight": "model-00049-of-00234.safetensors",
108
+ "model.layers.14.mlp.switch_mlp.gate_proj.weight": "model-00047-of-00234.safetensors",
109
+ "model.layers.14.mlp.switch_mlp.up_proj.weight": "model-00048-of-00234.safetensors",
110
+ "model.layers.14.post_attention_layernorm.weight": "model-00050-of-00234.safetensors",
111
+ "model.layers.14.self_attn.kv_a_layernorm.weight": "model-00046-of-00234.safetensors",
112
+ "model.layers.14.self_attn.kv_a_proj_with_mqa.weight": "model-00046-of-00234.safetensors",
113
+ "model.layers.14.self_attn.kv_b_proj.weight": "model-00046-of-00234.safetensors",
114
+ "model.layers.14.self_attn.o_proj.weight": "model-00046-of-00234.safetensors",
115
+ "model.layers.14.self_attn.q_a_layernorm.weight": "model-00046-of-00234.safetensors",
116
+ "model.layers.14.self_attn.q_a_proj.weight": "model-00046-of-00234.safetensors",
117
+ "model.layers.14.self_attn.q_b_proj.weight": "model-00046-of-00234.safetensors",
118
+ "model.layers.15.input_layernorm.weight": "model-00054-of-00234.safetensors",
119
+ "model.layers.15.mlp.gate.e_score_correction_bias": "model-00054-of-00234.safetensors",
120
+ "model.layers.15.mlp.gate.weight": "model-00054-of-00234.safetensors",
121
+ "model.layers.15.mlp.shared_experts.down_proj.weight": "model-00054-of-00234.safetensors",
122
+ "model.layers.15.mlp.shared_experts.gate_proj.weight": "model-00054-of-00234.safetensors",
123
+ "model.layers.15.mlp.shared_experts.up_proj.weight": "model-00054-of-00234.safetensors",
124
+ "model.layers.15.mlp.switch_mlp.down_proj.weight": "model-00053-of-00234.safetensors",
125
+ "model.layers.15.mlp.switch_mlp.gate_proj.weight": "model-00051-of-00234.safetensors",
126
+ "model.layers.15.mlp.switch_mlp.up_proj.weight": "model-00052-of-00234.safetensors",
127
+ "model.layers.15.post_attention_layernorm.weight": "model-00054-of-00234.safetensors",
128
+ "model.layers.15.self_attn.kv_a_layernorm.weight": "model-00050-of-00234.safetensors",
129
+ "model.layers.15.self_attn.kv_a_proj_with_mqa.weight": "model-00050-of-00234.safetensors",
130
+ "model.layers.15.self_attn.kv_b_proj.weight": "model-00050-of-00234.safetensors",
131
+ "model.layers.15.self_attn.o_proj.weight": "model-00050-of-00234.safetensors",
132
+ "model.layers.15.self_attn.q_a_layernorm.weight": "model-00050-of-00234.safetensors",
133
+ "model.layers.15.self_attn.q_a_proj.weight": "model-00050-of-00234.safetensors",
134
+ "model.layers.15.self_attn.q_b_proj.weight": "model-00050-of-00234.safetensors",
135
+ "model.layers.16.input_layernorm.weight": "model-00058-of-00234.safetensors",
136
+ "model.layers.16.mlp.gate.e_score_correction_bias": "model-00058-of-00234.safetensors",
137
+ "model.layers.16.mlp.gate.weight": "model-00058-of-00234.safetensors",
138
+ "model.layers.16.mlp.shared_experts.down_proj.weight": "model-00058-of-00234.safetensors",
139
+ "model.layers.16.mlp.shared_experts.gate_proj.weight": "model-00058-of-00234.safetensors",
140
+ "model.layers.16.mlp.shared_experts.up_proj.weight": "model-00058-of-00234.safetensors",
141
+ "model.layers.16.mlp.switch_mlp.down_proj.weight": "model-00057-of-00234.safetensors",
142
+ "model.layers.16.mlp.switch_mlp.gate_proj.weight": "model-00055-of-00234.safetensors",
143
+ "model.layers.16.mlp.switch_mlp.up_proj.weight": "model-00056-of-00234.safetensors",
144
+ "model.layers.16.post_attention_layernorm.weight": "model-00058-of-00234.safetensors",
145
+ "model.layers.16.self_attn.kv_a_layernorm.weight": "model-00054-of-00234.safetensors",
146
+ "model.layers.16.self_attn.kv_a_proj_with_mqa.weight": "model-00054-of-00234.safetensors",
147
+ "model.layers.16.self_attn.kv_b_proj.weight": "model-00054-of-00234.safetensors",
148
+ "model.layers.16.self_attn.o_proj.weight": "model-00054-of-00234.safetensors",
149
+ "model.layers.16.self_attn.q_a_layernorm.weight": "model-00054-of-00234.safetensors",
150
+ "model.layers.16.self_attn.q_a_proj.weight": "model-00054-of-00234.safetensors",
151
+ "model.layers.16.self_attn.q_b_proj.weight": "model-00054-of-00234.safetensors",
152
+ "model.layers.17.input_layernorm.weight": "model-00062-of-00234.safetensors",
153
+ "model.layers.17.mlp.gate.e_score_correction_bias": "model-00062-of-00234.safetensors",
154
+ "model.layers.17.mlp.gate.weight": "model-00062-of-00234.safetensors",
155
+ "model.layers.17.mlp.shared_experts.down_proj.weight": "model-00062-of-00234.safetensors",
156
+ "model.layers.17.mlp.shared_experts.gate_proj.weight": "model-00062-of-00234.safetensors",
157
+ "model.layers.17.mlp.shared_experts.up_proj.weight": "model-00062-of-00234.safetensors",
158
+ "model.layers.17.mlp.switch_mlp.down_proj.weight": "model-00061-of-00234.safetensors",
159
+ "model.layers.17.mlp.switch_mlp.gate_proj.weight": "model-00059-of-00234.safetensors",
160
+ "model.layers.17.mlp.switch_mlp.up_proj.weight": "model-00060-of-00234.safetensors",
161
+ "model.layers.17.post_attention_layernorm.weight": "model-00062-of-00234.safetensors",
162
+ "model.layers.17.self_attn.kv_a_layernorm.weight": "model-00058-of-00234.safetensors",
163
+ "model.layers.17.self_attn.kv_a_proj_with_mqa.weight": "model-00058-of-00234.safetensors",
164
+ "model.layers.17.self_attn.kv_b_proj.weight": "model-00058-of-00234.safetensors",
165
+ "model.layers.17.self_attn.o_proj.weight": "model-00058-of-00234.safetensors",
166
+ "model.layers.17.self_attn.q_a_layernorm.weight": "model-00058-of-00234.safetensors",
167
+ "model.layers.17.self_attn.q_a_proj.weight": "model-00058-of-00234.safetensors",
168
+ "model.layers.17.self_attn.q_b_proj.weight": "model-00058-of-00234.safetensors",
169
+ "model.layers.18.input_layernorm.weight": "model-00066-of-00234.safetensors",
170
+ "model.layers.18.mlp.gate.e_score_correction_bias": "model-00066-of-00234.safetensors",
171
+ "model.layers.18.mlp.gate.weight": "model-00066-of-00234.safetensors",
172
+ "model.layers.18.mlp.shared_experts.down_proj.weight": "model-00066-of-00234.safetensors",
173
+ "model.layers.18.mlp.shared_experts.gate_proj.weight": "model-00066-of-00234.safetensors",
174
+ "model.layers.18.mlp.shared_experts.up_proj.weight": "model-00066-of-00234.safetensors",
175
+ "model.layers.18.mlp.switch_mlp.down_proj.weight": "model-00065-of-00234.safetensors",
176
+ "model.layers.18.mlp.switch_mlp.gate_proj.weight": "model-00063-of-00234.safetensors",
177
+ "model.layers.18.mlp.switch_mlp.up_proj.weight": "model-00064-of-00234.safetensors",
178
+ "model.layers.18.post_attention_layernorm.weight": "model-00066-of-00234.safetensors",
179
+ "model.layers.18.self_attn.kv_a_layernorm.weight": "model-00062-of-00234.safetensors",
180
+ "model.layers.18.self_attn.kv_a_proj_with_mqa.weight": "model-00062-of-00234.safetensors",
181
+ "model.layers.18.self_attn.kv_b_proj.weight": "model-00062-of-00234.safetensors",
182
+ "model.layers.18.self_attn.o_proj.weight": "model-00062-of-00234.safetensors",
183
+ "model.layers.18.self_attn.q_a_layernorm.weight": "model-00062-of-00234.safetensors",
184
+ "model.layers.18.self_attn.q_a_proj.weight": "model-00062-of-00234.safetensors",
185
+ "model.layers.18.self_attn.q_b_proj.weight": "model-00062-of-00234.safetensors",
186
+ "model.layers.19.input_layernorm.weight": "model-00070-of-00234.safetensors",
187
+ "model.layers.19.mlp.gate.e_score_correction_bias": "model-00070-of-00234.safetensors",
188
+ "model.layers.19.mlp.gate.weight": "model-00070-of-00234.safetensors",
189
+ "model.layers.19.mlp.shared_experts.down_proj.weight": "model-00070-of-00234.safetensors",
190
+ "model.layers.19.mlp.shared_experts.gate_proj.weight": "model-00070-of-00234.safetensors",
191
+ "model.layers.19.mlp.shared_experts.up_proj.weight": "model-00070-of-00234.safetensors",
192
+ "model.layers.19.mlp.switch_mlp.down_proj.weight": "model-00069-of-00234.safetensors",
193
+ "model.layers.19.mlp.switch_mlp.gate_proj.weight": "model-00067-of-00234.safetensors",
194
+ "model.layers.19.mlp.switch_mlp.up_proj.weight": "model-00068-of-00234.safetensors",
195
+ "model.layers.19.post_attention_layernorm.weight": "model-00070-of-00234.safetensors",
196
+ "model.layers.19.self_attn.kv_a_layernorm.weight": "model-00066-of-00234.safetensors",
197
+ "model.layers.19.self_attn.kv_a_proj_with_mqa.weight": "model-00066-of-00234.safetensors",
198
+ "model.layers.19.self_attn.kv_b_proj.weight": "model-00066-of-00234.safetensors",
199
+ "model.layers.19.self_attn.o_proj.weight": "model-00066-of-00234.safetensors",
200
+ "model.layers.19.self_attn.q_a_layernorm.weight": "model-00066-of-00234.safetensors",
201
+ "model.layers.19.self_attn.q_a_proj.weight": "model-00066-of-00234.safetensors",
202
+ "model.layers.19.self_attn.q_b_proj.weight": "model-00066-of-00234.safetensors",
203
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00234.safetensors",
204
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00234.safetensors",
205
+ "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00234.safetensors",
206
+ "model.layers.2.mlp.up_proj.weight": "model-00001-of-00234.safetensors",
207
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00234.safetensors",
208
+ "model.layers.2.self_attn.kv_a_layernorm.weight": "model-00001-of-00234.safetensors",
209
+ "model.layers.2.self_attn.kv_a_proj_with_mqa.weight": "model-00001-of-00234.safetensors",
210
+ "model.layers.2.self_attn.kv_b_proj.weight": "model-00001-of-00234.safetensors",
211
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00234.safetensors",
212
+ "model.layers.2.self_attn.q_a_layernorm.weight": "model-00001-of-00234.safetensors",
213
+ "model.layers.2.self_attn.q_a_proj.weight": "model-00001-of-00234.safetensors",
214
+ "model.layers.2.self_attn.q_b_proj.weight": "model-00001-of-00234.safetensors",
215
+ "model.layers.20.input_layernorm.weight": "model-00074-of-00234.safetensors",
216
+ "model.layers.20.mlp.gate.e_score_correction_bias": "model-00074-of-00234.safetensors",
217
+ "model.layers.20.mlp.gate.weight": "model-00074-of-00234.safetensors",
218
+ "model.layers.20.mlp.shared_experts.down_proj.weight": "model-00074-of-00234.safetensors",
219
+ "model.layers.20.mlp.shared_experts.gate_proj.weight": "model-00074-of-00234.safetensors",
220
+ "model.layers.20.mlp.shared_experts.up_proj.weight": "model-00074-of-00234.safetensors",
221
+ "model.layers.20.mlp.switch_mlp.down_proj.weight": "model-00073-of-00234.safetensors",
222
+ "model.layers.20.mlp.switch_mlp.gate_proj.weight": "model-00071-of-00234.safetensors",
223
+ "model.layers.20.mlp.switch_mlp.up_proj.weight": "model-00072-of-00234.safetensors",
224
+ "model.layers.20.post_attention_layernorm.weight": "model-00074-of-00234.safetensors",
225
+ "model.layers.20.self_attn.kv_a_layernorm.weight": "model-00070-of-00234.safetensors",
226
+ "model.layers.20.self_attn.kv_a_proj_with_mqa.weight": "model-00070-of-00234.safetensors",
227
+ "model.layers.20.self_attn.kv_b_proj.weight": "model-00070-of-00234.safetensors",
228
+ "model.layers.20.self_attn.o_proj.weight": "model-00070-of-00234.safetensors",
229
+ "model.layers.20.self_attn.q_a_layernorm.weight": "model-00070-of-00234.safetensors",
230
+ "model.layers.20.self_attn.q_a_proj.weight": "model-00070-of-00234.safetensors",
231
+ "model.layers.20.self_attn.q_b_proj.weight": "model-00070-of-00234.safetensors",
232
+ "model.layers.21.input_layernorm.weight": "model-00078-of-00234.safetensors",
233
+ "model.layers.21.mlp.gate.e_score_correction_bias": "model-00078-of-00234.safetensors",
234
+ "model.layers.21.mlp.gate.weight": "model-00078-of-00234.safetensors",
235
+ "model.layers.21.mlp.shared_experts.down_proj.weight": "model-00078-of-00234.safetensors",
236
+ "model.layers.21.mlp.shared_experts.gate_proj.weight": "model-00078-of-00234.safetensors",
237
+ "model.layers.21.mlp.shared_experts.up_proj.weight": "model-00078-of-00234.safetensors",
238
+ "model.layers.21.mlp.switch_mlp.down_proj.weight": "model-00077-of-00234.safetensors",
239
+ "model.layers.21.mlp.switch_mlp.gate_proj.weight": "model-00075-of-00234.safetensors",
240
+ "model.layers.21.mlp.switch_mlp.up_proj.weight": "model-00076-of-00234.safetensors",
241
+ "model.layers.21.post_attention_layernorm.weight": "model-00078-of-00234.safetensors",
242
+ "model.layers.21.self_attn.kv_a_layernorm.weight": "model-00074-of-00234.safetensors",
243
+ "model.layers.21.self_attn.kv_a_proj_with_mqa.weight": "model-00074-of-00234.safetensors",
244
+ "model.layers.21.self_attn.kv_b_proj.weight": "model-00074-of-00234.safetensors",
245
+ "model.layers.21.self_attn.o_proj.weight": "model-00074-of-00234.safetensors",
246
+ "model.layers.21.self_attn.q_a_layernorm.weight": "model-00074-of-00234.safetensors",
247
+ "model.layers.21.self_attn.q_a_proj.weight": "model-00074-of-00234.safetensors",
248
+ "model.layers.21.self_attn.q_b_proj.weight": "model-00074-of-00234.safetensors",
249
+ "model.layers.22.input_layernorm.weight": "model-00082-of-00234.safetensors",
250
+ "model.layers.22.mlp.gate.e_score_correction_bias": "model-00082-of-00234.safetensors",
251
+ "model.layers.22.mlp.gate.weight": "model-00082-of-00234.safetensors",
252
+ "model.layers.22.mlp.shared_experts.down_proj.weight": "model-00082-of-00234.safetensors",
253
+ "model.layers.22.mlp.shared_experts.gate_proj.weight": "model-00082-of-00234.safetensors",
254
+ "model.layers.22.mlp.shared_experts.up_proj.weight": "model-00082-of-00234.safetensors",
255
+ "model.layers.22.mlp.switch_mlp.down_proj.weight": "model-00081-of-00234.safetensors",
256
+ "model.layers.22.mlp.switch_mlp.gate_proj.weight": "model-00079-of-00234.safetensors",
257
+ "model.layers.22.mlp.switch_mlp.up_proj.weight": "model-00080-of-00234.safetensors",
258
+ "model.layers.22.post_attention_layernorm.weight": "model-00082-of-00234.safetensors",
259
+ "model.layers.22.self_attn.kv_a_layernorm.weight": "model-00078-of-00234.safetensors",
260
+ "model.layers.22.self_attn.kv_a_proj_with_mqa.weight": "model-00078-of-00234.safetensors",
261
+ "model.layers.22.self_attn.kv_b_proj.weight": "model-00078-of-00234.safetensors",
262
+ "model.layers.22.self_attn.o_proj.weight": "model-00078-of-00234.safetensors",
263
+ "model.layers.22.self_attn.q_a_layernorm.weight": "model-00078-of-00234.safetensors",
264
+ "model.layers.22.self_attn.q_a_proj.weight": "model-00078-of-00234.safetensors",
265
+ "model.layers.22.self_attn.q_b_proj.weight": "model-00078-of-00234.safetensors",
266
+ "model.layers.23.input_layernorm.weight": "model-00086-of-00234.safetensors",
267
+ "model.layers.23.mlp.gate.e_score_correction_bias": "model-00086-of-00234.safetensors",
268
+ "model.layers.23.mlp.gate.weight": "model-00086-of-00234.safetensors",
269
+ "model.layers.23.mlp.shared_experts.down_proj.weight": "model-00086-of-00234.safetensors",
270
+ "model.layers.23.mlp.shared_experts.gate_proj.weight": "model-00086-of-00234.safetensors",
271
+ "model.layers.23.mlp.shared_experts.up_proj.weight": "model-00086-of-00234.safetensors",
272
+ "model.layers.23.mlp.switch_mlp.down_proj.weight": "model-00085-of-00234.safetensors",
273
+ "model.layers.23.mlp.switch_mlp.gate_proj.weight": "model-00083-of-00234.safetensors",
274
+ "model.layers.23.mlp.switch_mlp.up_proj.weight": "model-00084-of-00234.safetensors",
275
+ "model.layers.23.post_attention_layernorm.weight": "model-00086-of-00234.safetensors",
276
+ "model.layers.23.self_attn.kv_a_layernorm.weight": "model-00082-of-00234.safetensors",
277
+ "model.layers.23.self_attn.kv_a_proj_with_mqa.weight": "model-00082-of-00234.safetensors",
278
+ "model.layers.23.self_attn.kv_b_proj.weight": "model-00082-of-00234.safetensors",
279
+ "model.layers.23.self_attn.o_proj.weight": "model-00082-of-00234.safetensors",
280
+ "model.layers.23.self_attn.q_a_layernorm.weight": "model-00082-of-00234.safetensors",
281
+ "model.layers.23.self_attn.q_a_proj.weight": "model-00082-of-00234.safetensors",
282
+ "model.layers.23.self_attn.q_b_proj.weight": "model-00082-of-00234.safetensors",
283
+ "model.layers.24.input_layernorm.weight": "model-00090-of-00234.safetensors",
284
+ "model.layers.24.mlp.gate.e_score_correction_bias": "model-00090-of-00234.safetensors",
285
+ "model.layers.24.mlp.gate.weight": "model-00090-of-00234.safetensors",
286
+ "model.layers.24.mlp.shared_experts.down_proj.weight": "model-00090-of-00234.safetensors",
287
+ "model.layers.24.mlp.shared_experts.gate_proj.weight": "model-00090-of-00234.safetensors",
288
+ "model.layers.24.mlp.shared_experts.up_proj.weight": "model-00090-of-00234.safetensors",
289
+ "model.layers.24.mlp.switch_mlp.down_proj.weight": "model-00089-of-00234.safetensors",
290
+ "model.layers.24.mlp.switch_mlp.gate_proj.weight": "model-00087-of-00234.safetensors",
291
+ "model.layers.24.mlp.switch_mlp.up_proj.weight": "model-00088-of-00234.safetensors",
292
+ "model.layers.24.post_attention_layernorm.weight": "model-00090-of-00234.safetensors",
293
+ "model.layers.24.self_attn.kv_a_layernorm.weight": "model-00086-of-00234.safetensors",
294
+ "model.layers.24.self_attn.kv_a_proj_with_mqa.weight": "model-00086-of-00234.safetensors",
295
+ "model.layers.24.self_attn.kv_b_proj.weight": "model-00086-of-00234.safetensors",
296
+ "model.layers.24.self_attn.o_proj.weight": "model-00086-of-00234.safetensors",
297
+ "model.layers.24.self_attn.q_a_layernorm.weight": "model-00086-of-00234.safetensors",
298
+ "model.layers.24.self_attn.q_a_proj.weight": "model-00086-of-00234.safetensors",
299
+ "model.layers.24.self_attn.q_b_proj.weight": "model-00086-of-00234.safetensors",
300
+ "model.layers.25.input_layernorm.weight": "model-00094-of-00234.safetensors",
301
+ "model.layers.25.mlp.gate.e_score_correction_bias": "model-00094-of-00234.safetensors",
302
+ "model.layers.25.mlp.gate.weight": "model-00094-of-00234.safetensors",
303
+ "model.layers.25.mlp.shared_experts.down_proj.weight": "model-00094-of-00234.safetensors",
304
+ "model.layers.25.mlp.shared_experts.gate_proj.weight": "model-00094-of-00234.safetensors",
305
+ "model.layers.25.mlp.shared_experts.up_proj.weight": "model-00094-of-00234.safetensors",
306
+ "model.layers.25.mlp.switch_mlp.down_proj.weight": "model-00093-of-00234.safetensors",
307
+ "model.layers.25.mlp.switch_mlp.gate_proj.weight": "model-00091-of-00234.safetensors",
308
+ "model.layers.25.mlp.switch_mlp.up_proj.weight": "model-00092-of-00234.safetensors",
309
+ "model.layers.25.post_attention_layernorm.weight": "model-00094-of-00234.safetensors",
310
+ "model.layers.25.self_attn.kv_a_layernorm.weight": "model-00090-of-00234.safetensors",
311
+ "model.layers.25.self_attn.kv_a_proj_with_mqa.weight": "model-00090-of-00234.safetensors",
312
+ "model.layers.25.self_attn.kv_b_proj.weight": "model-00090-of-00234.safetensors",
313
+ "model.layers.25.self_attn.o_proj.weight": "model-00090-of-00234.safetensors",
314
+ "model.layers.25.self_attn.q_a_layernorm.weight": "model-00090-of-00234.safetensors",
315
+ "model.layers.25.self_attn.q_a_proj.weight": "model-00090-of-00234.safetensors",
316
+ "model.layers.25.self_attn.q_b_proj.weight": "model-00090-of-00234.safetensors",
317
+ "model.layers.26.input_layernorm.weight": "model-00098-of-00234.safetensors",
318
+ "model.layers.26.mlp.gate.e_score_correction_bias": "model-00098-of-00234.safetensors",
319
+ "model.layers.26.mlp.gate.weight": "model-00098-of-00234.safetensors",
320
+ "model.layers.26.mlp.shared_experts.down_proj.weight": "model-00098-of-00234.safetensors",
321
+ "model.layers.26.mlp.shared_experts.gate_proj.weight": "model-00098-of-00234.safetensors",
322
+ "model.layers.26.mlp.shared_experts.up_proj.weight": "model-00098-of-00234.safetensors",
323
+ "model.layers.26.mlp.switch_mlp.down_proj.weight": "model-00097-of-00234.safetensors",
324
+ "model.layers.26.mlp.switch_mlp.gate_proj.weight": "model-00095-of-00234.safetensors",
325
+ "model.layers.26.mlp.switch_mlp.up_proj.weight": "model-00096-of-00234.safetensors",
326
+ "model.layers.26.post_attention_layernorm.weight": "model-00098-of-00234.safetensors",
327
+ "model.layers.26.self_attn.kv_a_layernorm.weight": "model-00094-of-00234.safetensors",
328
+ "model.layers.26.self_attn.kv_a_proj_with_mqa.weight": "model-00094-of-00234.safetensors",
329
+ "model.layers.26.self_attn.kv_b_proj.weight": "model-00094-of-00234.safetensors",
330
+ "model.layers.26.self_attn.o_proj.weight": "model-00094-of-00234.safetensors",
331
+ "model.layers.26.self_attn.q_a_layernorm.weight": "model-00094-of-00234.safetensors",
332
+ "model.layers.26.self_attn.q_a_proj.weight": "model-00094-of-00234.safetensors",
333
+ "model.layers.26.self_attn.q_b_proj.weight": "model-00094-of-00234.safetensors",
334
+ "model.layers.27.input_layernorm.weight": "model-00102-of-00234.safetensors",
335
+ "model.layers.27.mlp.gate.e_score_correction_bias": "model-00102-of-00234.safetensors",
336
+ "model.layers.27.mlp.gate.weight": "model-00102-of-00234.safetensors",
337
+ "model.layers.27.mlp.shared_experts.down_proj.weight": "model-00102-of-00234.safetensors",
338
+ "model.layers.27.mlp.shared_experts.gate_proj.weight": "model-00102-of-00234.safetensors",
339
+ "model.layers.27.mlp.shared_experts.up_proj.weight": "model-00102-of-00234.safetensors",
340
+ "model.layers.27.mlp.switch_mlp.down_proj.weight": "model-00101-of-00234.safetensors",
341
+ "model.layers.27.mlp.switch_mlp.gate_proj.weight": "model-00099-of-00234.safetensors",
342
+ "model.layers.27.mlp.switch_mlp.up_proj.weight": "model-00100-of-00234.safetensors",
343
+ "model.layers.27.post_attention_layernorm.weight": "model-00102-of-00234.safetensors",
344
+ "model.layers.27.self_attn.kv_a_layernorm.weight": "model-00098-of-00234.safetensors",
345
+ "model.layers.27.self_attn.kv_a_proj_with_mqa.weight": "model-00098-of-00234.safetensors",
346
+ "model.layers.27.self_attn.kv_b_proj.weight": "model-00098-of-00234.safetensors",
347
+ "model.layers.27.self_attn.o_proj.weight": "model-00098-of-00234.safetensors",
348
+ "model.layers.27.self_attn.q_a_layernorm.weight": "model-00098-of-00234.safetensors",
349
+ "model.layers.27.self_attn.q_a_proj.weight": "model-00098-of-00234.safetensors",
350
+ "model.layers.27.self_attn.q_b_proj.weight": "model-00098-of-00234.safetensors",
351
+ "model.layers.28.input_layernorm.weight": "model-00106-of-00234.safetensors",
352
+ "model.layers.28.mlp.gate.e_score_correction_bias": "model-00106-of-00234.safetensors",
353
+ "model.layers.28.mlp.gate.weight": "model-00106-of-00234.safetensors",
354
+ "model.layers.28.mlp.shared_experts.down_proj.weight": "model-00106-of-00234.safetensors",
355
+ "model.layers.28.mlp.shared_experts.gate_proj.weight": "model-00106-of-00234.safetensors",
356
+ "model.layers.28.mlp.shared_experts.up_proj.weight": "model-00106-of-00234.safetensors",
357
+ "model.layers.28.mlp.switch_mlp.down_proj.weight": "model-00105-of-00234.safetensors",
358
+ "model.layers.28.mlp.switch_mlp.gate_proj.weight": "model-00103-of-00234.safetensors",
359
+ "model.layers.28.mlp.switch_mlp.up_proj.weight": "model-00104-of-00234.safetensors",
360
+ "model.layers.28.post_attention_layernorm.weight": "model-00106-of-00234.safetensors",
361
+ "model.layers.28.self_attn.kv_a_layernorm.weight": "model-00102-of-00234.safetensors",
362
+ "model.layers.28.self_attn.kv_a_proj_with_mqa.weight": "model-00102-of-00234.safetensors",
363
+ "model.layers.28.self_attn.kv_b_proj.weight": "model-00102-of-00234.safetensors",
364
+ "model.layers.28.self_attn.o_proj.weight": "model-00102-of-00234.safetensors",
365
+ "model.layers.28.self_attn.q_a_layernorm.weight": "model-00102-of-00234.safetensors",
366
+ "model.layers.28.self_attn.q_a_proj.weight": "model-00102-of-00234.safetensors",
367
+ "model.layers.28.self_attn.q_b_proj.weight": "model-00102-of-00234.safetensors",
368
+ "model.layers.29.input_layernorm.weight": "model-00110-of-00234.safetensors",
369
+ "model.layers.29.mlp.gate.e_score_correction_bias": "model-00110-of-00234.safetensors",
370
+ "model.layers.29.mlp.gate.weight": "model-00110-of-00234.safetensors",
371
+ "model.layers.29.mlp.shared_experts.down_proj.weight": "model-00110-of-00234.safetensors",
372
+ "model.layers.29.mlp.shared_experts.gate_proj.weight": "model-00110-of-00234.safetensors",
373
+ "model.layers.29.mlp.shared_experts.up_proj.weight": "model-00110-of-00234.safetensors",
374
+ "model.layers.29.mlp.switch_mlp.down_proj.weight": "model-00109-of-00234.safetensors",
375
+ "model.layers.29.mlp.switch_mlp.gate_proj.weight": "model-00107-of-00234.safetensors",
376
+ "model.layers.29.mlp.switch_mlp.up_proj.weight": "model-00108-of-00234.safetensors",
377
+ "model.layers.29.post_attention_layernorm.weight": "model-00110-of-00234.safetensors",
378
+ "model.layers.29.self_attn.kv_a_layernorm.weight": "model-00106-of-00234.safetensors",
379
+ "model.layers.29.self_attn.kv_a_proj_with_mqa.weight": "model-00106-of-00234.safetensors",
380
+ "model.layers.29.self_attn.kv_b_proj.weight": "model-00106-of-00234.safetensors",
381
+ "model.layers.29.self_attn.o_proj.weight": "model-00106-of-00234.safetensors",
382
+ "model.layers.29.self_attn.q_a_layernorm.weight": "model-00106-of-00234.safetensors",
383
+ "model.layers.29.self_attn.q_a_proj.weight": "model-00106-of-00234.safetensors",
384
+ "model.layers.29.self_attn.q_b_proj.weight": "model-00106-of-00234.safetensors",
385
+ "model.layers.3.input_layernorm.weight": "model-00006-of-00234.safetensors",
386
+ "model.layers.3.mlp.gate.e_score_correction_bias": "model-00006-of-00234.safetensors",
387
+ "model.layers.3.mlp.gate.weight": "model-00006-of-00234.safetensors",
388
+ "model.layers.3.mlp.shared_experts.down_proj.weight": "model-00006-of-00234.safetensors",
389
+ "model.layers.3.mlp.shared_experts.gate_proj.weight": "model-00006-of-00234.safetensors",
390
+ "model.layers.3.mlp.shared_experts.up_proj.weight": "model-00006-of-00234.safetensors",
391
+ "model.layers.3.mlp.switch_mlp.down_proj.weight": "model-00005-of-00234.safetensors",
392
+ "model.layers.3.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00234.safetensors",
393
+ "model.layers.3.mlp.switch_mlp.up_proj.weight": "model-00004-of-00234.safetensors",
394
+ "model.layers.3.post_attention_layernorm.weight": "model-00006-of-00234.safetensors",
395
+ "model.layers.3.self_attn.kv_a_layernorm.weight": "model-00002-of-00234.safetensors",
396
+ "model.layers.3.self_attn.kv_a_proj_with_mqa.weight": "model-00002-of-00234.safetensors",
397
+ "model.layers.3.self_attn.kv_b_proj.weight": "model-00002-of-00234.safetensors",
398
+ "model.layers.3.self_attn.o_proj.weight": "model-00002-of-00234.safetensors",
399
+ "model.layers.3.self_attn.q_a_layernorm.weight": "model-00002-of-00234.safetensors",
400
+ "model.layers.3.self_attn.q_a_proj.weight": "model-00002-of-00234.safetensors",
401
+ "model.layers.3.self_attn.q_b_proj.weight": "model-00002-of-00234.safetensors",
402
+ "model.layers.30.input_layernorm.weight": "model-00114-of-00234.safetensors",
403
+ "model.layers.30.mlp.gate.e_score_correction_bias": "model-00114-of-00234.safetensors",
404
+ "model.layers.30.mlp.gate.weight": "model-00114-of-00234.safetensors",
405
+ "model.layers.30.mlp.shared_experts.down_proj.weight": "model-00114-of-00234.safetensors",
406
+ "model.layers.30.mlp.shared_experts.gate_proj.weight": "model-00114-of-00234.safetensors",
407
+ "model.layers.30.mlp.shared_experts.up_proj.weight": "model-00114-of-00234.safetensors",
408
+ "model.layers.30.mlp.switch_mlp.down_proj.weight": "model-00113-of-00234.safetensors",
409
+ "model.layers.30.mlp.switch_mlp.gate_proj.weight": "model-00111-of-00234.safetensors",
410
+ "model.layers.30.mlp.switch_mlp.up_proj.weight": "model-00112-of-00234.safetensors",
411
+ "model.layers.30.post_attention_layernorm.weight": "model-00114-of-00234.safetensors",
412
+ "model.layers.30.self_attn.kv_a_layernorm.weight": "model-00110-of-00234.safetensors",
413
+ "model.layers.30.self_attn.kv_a_proj_with_mqa.weight": "model-00110-of-00234.safetensors",
414
+ "model.layers.30.self_attn.kv_b_proj.weight": "model-00110-of-00234.safetensors",
415
+ "model.layers.30.self_attn.o_proj.weight": "model-00110-of-00234.safetensors",
416
+ "model.layers.30.self_attn.q_a_layernorm.weight": "model-00110-of-00234.safetensors",
417
+ "model.layers.30.self_attn.q_a_proj.weight": "model-00110-of-00234.safetensors",
418
+ "model.layers.30.self_attn.q_b_proj.weight": "model-00110-of-00234.safetensors",
419
+ "model.layers.31.input_layernorm.weight": "model-00118-of-00234.safetensors",
420
+ "model.layers.31.mlp.gate.e_score_correction_bias": "model-00118-of-00234.safetensors",
421
+ "model.layers.31.mlp.gate.weight": "model-00118-of-00234.safetensors",
422
+ "model.layers.31.mlp.shared_experts.down_proj.weight": "model-00118-of-00234.safetensors",
423
+ "model.layers.31.mlp.shared_experts.gate_proj.weight": "model-00118-of-00234.safetensors",
424
+ "model.layers.31.mlp.shared_experts.up_proj.weight": "model-00118-of-00234.safetensors",
425
+ "model.layers.31.mlp.switch_mlp.down_proj.weight": "model-00117-of-00234.safetensors",
426
+ "model.layers.31.mlp.switch_mlp.gate_proj.weight": "model-00115-of-00234.safetensors",
427
+ "model.layers.31.mlp.switch_mlp.up_proj.weight": "model-00116-of-00234.safetensors",
428
+ "model.layers.31.post_attention_layernorm.weight": "model-00118-of-00234.safetensors",
429
+ "model.layers.31.self_attn.kv_a_layernorm.weight": "model-00114-of-00234.safetensors",
430
+ "model.layers.31.self_attn.kv_a_proj_with_mqa.weight": "model-00114-of-00234.safetensors",
431
+ "model.layers.31.self_attn.kv_b_proj.weight": "model-00114-of-00234.safetensors",
432
+ "model.layers.31.self_attn.o_proj.weight": "model-00114-of-00234.safetensors",
433
+ "model.layers.31.self_attn.q_a_layernorm.weight": "model-00114-of-00234.safetensors",
434
+ "model.layers.31.self_attn.q_a_proj.weight": "model-00114-of-00234.safetensors",
435
+ "model.layers.31.self_attn.q_b_proj.weight": "model-00114-of-00234.safetensors",
436
+ "model.layers.32.input_layernorm.weight": "model-00122-of-00234.safetensors",
437
+ "model.layers.32.mlp.gate.e_score_correction_bias": "model-00122-of-00234.safetensors",
438
+ "model.layers.32.mlp.gate.weight": "model-00122-of-00234.safetensors",
439
+ "model.layers.32.mlp.shared_experts.down_proj.weight": "model-00122-of-00234.safetensors",
440
+ "model.layers.32.mlp.shared_experts.gate_proj.weight": "model-00122-of-00234.safetensors",
441
+ "model.layers.32.mlp.shared_experts.up_proj.weight": "model-00122-of-00234.safetensors",
442
+ "model.layers.32.mlp.switch_mlp.down_proj.weight": "model-00121-of-00234.safetensors",
443
+ "model.layers.32.mlp.switch_mlp.gate_proj.weight": "model-00119-of-00234.safetensors",
444
+ "model.layers.32.mlp.switch_mlp.up_proj.weight": "model-00120-of-00234.safetensors",
445
+ "model.layers.32.post_attention_layernorm.weight": "model-00122-of-00234.safetensors",
446
+ "model.layers.32.self_attn.kv_a_layernorm.weight": "model-00118-of-00234.safetensors",
447
+ "model.layers.32.self_attn.kv_a_proj_with_mqa.weight": "model-00118-of-00234.safetensors",
448
+ "model.layers.32.self_attn.kv_b_proj.weight": "model-00118-of-00234.safetensors",
449
+ "model.layers.32.self_attn.o_proj.weight": "model-00118-of-00234.safetensors",
450
+ "model.layers.32.self_attn.q_a_layernorm.weight": "model-00118-of-00234.safetensors",
451
+ "model.layers.32.self_attn.q_a_proj.weight": "model-00118-of-00234.safetensors",
452
+ "model.layers.32.self_attn.q_b_proj.weight": "model-00118-of-00234.safetensors",
453
+ "model.layers.33.input_layernorm.weight": "model-00126-of-00234.safetensors",
454
+ "model.layers.33.mlp.gate.e_score_correction_bias": "model-00126-of-00234.safetensors",
455
+ "model.layers.33.mlp.gate.weight": "model-00126-of-00234.safetensors",
456
+ "model.layers.33.mlp.shared_experts.down_proj.weight": "model-00126-of-00234.safetensors",
457
+ "model.layers.33.mlp.shared_experts.gate_proj.weight": "model-00126-of-00234.safetensors",
458
+ "model.layers.33.mlp.shared_experts.up_proj.weight": "model-00126-of-00234.safetensors",
459
+ "model.layers.33.mlp.switch_mlp.down_proj.weight": "model-00125-of-00234.safetensors",
460
+ "model.layers.33.mlp.switch_mlp.gate_proj.weight": "model-00123-of-00234.safetensors",
461
+ "model.layers.33.mlp.switch_mlp.up_proj.weight": "model-00124-of-00234.safetensors",
462
+ "model.layers.33.post_attention_layernorm.weight": "model-00126-of-00234.safetensors",
463
+ "model.layers.33.self_attn.kv_a_layernorm.weight": "model-00122-of-00234.safetensors",
464
+ "model.layers.33.self_attn.kv_a_proj_with_mqa.weight": "model-00122-of-00234.safetensors",
465
+ "model.layers.33.self_attn.kv_b_proj.weight": "model-00122-of-00234.safetensors",
466
+ "model.layers.33.self_attn.o_proj.weight": "model-00122-of-00234.safetensors",
467
+ "model.layers.33.self_attn.q_a_layernorm.weight": "model-00122-of-00234.safetensors",
468
+ "model.layers.33.self_attn.q_a_proj.weight": "model-00122-of-00234.safetensors",
469
+ "model.layers.33.self_attn.q_b_proj.weight": "model-00122-of-00234.safetensors",
470
+ "model.layers.34.input_layernorm.weight": "model-00130-of-00234.safetensors",
471
+ "model.layers.34.mlp.gate.e_score_correction_bias": "model-00130-of-00234.safetensors",
472
+ "model.layers.34.mlp.gate.weight": "model-00130-of-00234.safetensors",
473
+ "model.layers.34.mlp.shared_experts.down_proj.weight": "model-00130-of-00234.safetensors",
474
+ "model.layers.34.mlp.shared_experts.gate_proj.weight": "model-00130-of-00234.safetensors",
475
+ "model.layers.34.mlp.shared_experts.up_proj.weight": "model-00130-of-00234.safetensors",
476
+ "model.layers.34.mlp.switch_mlp.down_proj.weight": "model-00129-of-00234.safetensors",
477
+ "model.layers.34.mlp.switch_mlp.gate_proj.weight": "model-00127-of-00234.safetensors",
478
+ "model.layers.34.mlp.switch_mlp.up_proj.weight": "model-00128-of-00234.safetensors",
479
+ "model.layers.34.post_attention_layernorm.weight": "model-00130-of-00234.safetensors",
480
+ "model.layers.34.self_attn.kv_a_layernorm.weight": "model-00126-of-00234.safetensors",
481
+ "model.layers.34.self_attn.kv_a_proj_with_mqa.weight": "model-00126-of-00234.safetensors",
482
+ "model.layers.34.self_attn.kv_b_proj.weight": "model-00126-of-00234.safetensors",
483
+ "model.layers.34.self_attn.o_proj.weight": "model-00126-of-00234.safetensors",
484
+ "model.layers.34.self_attn.q_a_layernorm.weight": "model-00126-of-00234.safetensors",
485
+ "model.layers.34.self_attn.q_a_proj.weight": "model-00126-of-00234.safetensors",
486
+ "model.layers.34.self_attn.q_b_proj.weight": "model-00126-of-00234.safetensors",
487
+ "model.layers.35.input_layernorm.weight": "model-00134-of-00234.safetensors",
488
+ "model.layers.35.mlp.gate.e_score_correction_bias": "model-00134-of-00234.safetensors",
489
+ "model.layers.35.mlp.gate.weight": "model-00134-of-00234.safetensors",
490
+ "model.layers.35.mlp.shared_experts.down_proj.weight": "model-00134-of-00234.safetensors",
491
+ "model.layers.35.mlp.shared_experts.gate_proj.weight": "model-00134-of-00234.safetensors",
492
+ "model.layers.35.mlp.shared_experts.up_proj.weight": "model-00134-of-00234.safetensors",
493
+ "model.layers.35.mlp.switch_mlp.down_proj.weight": "model-00133-of-00234.safetensors",
494
+ "model.layers.35.mlp.switch_mlp.gate_proj.weight": "model-00131-of-00234.safetensors",
495
+ "model.layers.35.mlp.switch_mlp.up_proj.weight": "model-00132-of-00234.safetensors",
496
+ "model.layers.35.post_attention_layernorm.weight": "model-00134-of-00234.safetensors",
497
+ "model.layers.35.self_attn.kv_a_layernorm.weight": "model-00130-of-00234.safetensors",
498
+ "model.layers.35.self_attn.kv_a_proj_with_mqa.weight": "model-00130-of-00234.safetensors",
499
+ "model.layers.35.self_attn.kv_b_proj.weight": "model-00130-of-00234.safetensors",
500
+ "model.layers.35.self_attn.o_proj.weight": "model-00130-of-00234.safetensors",
501
+ "model.layers.35.self_attn.q_a_layernorm.weight": "model-00130-of-00234.safetensors",
502
+ "model.layers.35.self_attn.q_a_proj.weight": "model-00130-of-00234.safetensors",
503
+ "model.layers.35.self_attn.q_b_proj.weight": "model-00130-of-00234.safetensors",
504
+ "model.layers.36.input_layernorm.weight": "model-00138-of-00234.safetensors",
505
+ "model.layers.36.mlp.gate.e_score_correction_bias": "model-00138-of-00234.safetensors",
506
+ "model.layers.36.mlp.gate.weight": "model-00138-of-00234.safetensors",
507
+ "model.layers.36.mlp.shared_experts.down_proj.weight": "model-00138-of-00234.safetensors",
508
+ "model.layers.36.mlp.shared_experts.gate_proj.weight": "model-00138-of-00234.safetensors",
509
+ "model.layers.36.mlp.shared_experts.up_proj.weight": "model-00138-of-00234.safetensors",
510
+ "model.layers.36.mlp.switch_mlp.down_proj.weight": "model-00137-of-00234.safetensors",
511
+ "model.layers.36.mlp.switch_mlp.gate_proj.weight": "model-00135-of-00234.safetensors",
512
+ "model.layers.36.mlp.switch_mlp.up_proj.weight": "model-00136-of-00234.safetensors",
513
+ "model.layers.36.post_attention_layernorm.weight": "model-00138-of-00234.safetensors",
514
+ "model.layers.36.self_attn.kv_a_layernorm.weight": "model-00134-of-00234.safetensors",
515
+ "model.layers.36.self_attn.kv_a_proj_with_mqa.weight": "model-00134-of-00234.safetensors",
516
+ "model.layers.36.self_attn.kv_b_proj.weight": "model-00134-of-00234.safetensors",
517
+ "model.layers.36.self_attn.o_proj.weight": "model-00134-of-00234.safetensors",
518
+ "model.layers.36.self_attn.q_a_layernorm.weight": "model-00134-of-00234.safetensors",
519
+ "model.layers.36.self_attn.q_a_proj.weight": "model-00134-of-00234.safetensors",
520
+ "model.layers.36.self_attn.q_b_proj.weight": "model-00134-of-00234.safetensors",
521
+ "model.layers.37.input_layernorm.weight": "model-00142-of-00234.safetensors",
522
+ "model.layers.37.mlp.gate.e_score_correction_bias": "model-00142-of-00234.safetensors",
523
+ "model.layers.37.mlp.gate.weight": "model-00142-of-00234.safetensors",
524
+ "model.layers.37.mlp.shared_experts.down_proj.weight": "model-00142-of-00234.safetensors",
525
+ "model.layers.37.mlp.shared_experts.gate_proj.weight": "model-00142-of-00234.safetensors",
526
+ "model.layers.37.mlp.shared_experts.up_proj.weight": "model-00142-of-00234.safetensors",
527
+ "model.layers.37.mlp.switch_mlp.down_proj.weight": "model-00141-of-00234.safetensors",
528
+ "model.layers.37.mlp.switch_mlp.gate_proj.weight": "model-00139-of-00234.safetensors",
529
+ "model.layers.37.mlp.switch_mlp.up_proj.weight": "model-00140-of-00234.safetensors",
530
+ "model.layers.37.post_attention_layernorm.weight": "model-00142-of-00234.safetensors",
531
+ "model.layers.37.self_attn.kv_a_layernorm.weight": "model-00138-of-00234.safetensors",
532
+ "model.layers.37.self_attn.kv_a_proj_with_mqa.weight": "model-00138-of-00234.safetensors",
533
+ "model.layers.37.self_attn.kv_b_proj.weight": "model-00138-of-00234.safetensors",
534
+ "model.layers.37.self_attn.o_proj.weight": "model-00138-of-00234.safetensors",
535
+ "model.layers.37.self_attn.q_a_layernorm.weight": "model-00138-of-00234.safetensors",
536
+ "model.layers.37.self_attn.q_a_proj.weight": "model-00138-of-00234.safetensors",
537
+ "model.layers.37.self_attn.q_b_proj.weight": "model-00138-of-00234.safetensors",
538
+ "model.layers.38.input_layernorm.weight": "model-00146-of-00234.safetensors",
539
+ "model.layers.38.mlp.gate.e_score_correction_bias": "model-00146-of-00234.safetensors",
540
+ "model.layers.38.mlp.gate.weight": "model-00146-of-00234.safetensors",
541
+ "model.layers.38.mlp.shared_experts.down_proj.weight": "model-00146-of-00234.safetensors",
542
+ "model.layers.38.mlp.shared_experts.gate_proj.weight": "model-00146-of-00234.safetensors",
543
+ "model.layers.38.mlp.shared_experts.up_proj.weight": "model-00146-of-00234.safetensors",
544
+ "model.layers.38.mlp.switch_mlp.down_proj.weight": "model-00145-of-00234.safetensors",
545
+ "model.layers.38.mlp.switch_mlp.gate_proj.weight": "model-00143-of-00234.safetensors",
546
+ "model.layers.38.mlp.switch_mlp.up_proj.weight": "model-00144-of-00234.safetensors",
547
+ "model.layers.38.post_attention_layernorm.weight": "model-00146-of-00234.safetensors",
548
+ "model.layers.38.self_attn.kv_a_layernorm.weight": "model-00142-of-00234.safetensors",
549
+ "model.layers.38.self_attn.kv_a_proj_with_mqa.weight": "model-00142-of-00234.safetensors",
550
+ "model.layers.38.self_attn.kv_b_proj.weight": "model-00142-of-00234.safetensors",
551
+ "model.layers.38.self_attn.o_proj.weight": "model-00142-of-00234.safetensors",
552
+ "model.layers.38.self_attn.q_a_layernorm.weight": "model-00142-of-00234.safetensors",
553
+ "model.layers.38.self_attn.q_a_proj.weight": "model-00142-of-00234.safetensors",
554
+ "model.layers.38.self_attn.q_b_proj.weight": "model-00142-of-00234.safetensors",
555
+ "model.layers.39.input_layernorm.weight": "model-00150-of-00234.safetensors",
556
+ "model.layers.39.mlp.gate.e_score_correction_bias": "model-00150-of-00234.safetensors",
557
+ "model.layers.39.mlp.gate.weight": "model-00150-of-00234.safetensors",
558
+ "model.layers.39.mlp.shared_experts.down_proj.weight": "model-00150-of-00234.safetensors",
559
+ "model.layers.39.mlp.shared_experts.gate_proj.weight": "model-00150-of-00234.safetensors",
560
+ "model.layers.39.mlp.shared_experts.up_proj.weight": "model-00150-of-00234.safetensors",
561
+ "model.layers.39.mlp.switch_mlp.down_proj.weight": "model-00149-of-00234.safetensors",
562
+ "model.layers.39.mlp.switch_mlp.gate_proj.weight": "model-00147-of-00234.safetensors",
563
+ "model.layers.39.mlp.switch_mlp.up_proj.weight": "model-00148-of-00234.safetensors",
564
+ "model.layers.39.post_attention_layernorm.weight": "model-00150-of-00234.safetensors",
565
+ "model.layers.39.self_attn.kv_a_layernorm.weight": "model-00146-of-00234.safetensors",
566
+ "model.layers.39.self_attn.kv_a_proj_with_mqa.weight": "model-00146-of-00234.safetensors",
567
+ "model.layers.39.self_attn.kv_b_proj.weight": "model-00146-of-00234.safetensors",
568
+ "model.layers.39.self_attn.o_proj.weight": "model-00146-of-00234.safetensors",
569
+ "model.layers.39.self_attn.q_a_layernorm.weight": "model-00146-of-00234.safetensors",
570
+ "model.layers.39.self_attn.q_a_proj.weight": "model-00146-of-00234.safetensors",
571
+ "model.layers.39.self_attn.q_b_proj.weight": "model-00146-of-00234.safetensors",
572
+ "model.layers.4.input_layernorm.weight": "model-00010-of-00234.safetensors",
573
+ "model.layers.4.mlp.gate.e_score_correction_bias": "model-00010-of-00234.safetensors",
574
+ "model.layers.4.mlp.gate.weight": "model-00010-of-00234.safetensors",
575
+ "model.layers.4.mlp.shared_experts.down_proj.weight": "model-00010-of-00234.safetensors",
576
+ "model.layers.4.mlp.shared_experts.gate_proj.weight": "model-00010-of-00234.safetensors",
577
+ "model.layers.4.mlp.shared_experts.up_proj.weight": "model-00010-of-00234.safetensors",
578
+ "model.layers.4.mlp.switch_mlp.down_proj.weight": "model-00009-of-00234.safetensors",
579
+ "model.layers.4.mlp.switch_mlp.gate_proj.weight": "model-00007-of-00234.safetensors",
580
+ "model.layers.4.mlp.switch_mlp.up_proj.weight": "model-00008-of-00234.safetensors",
581
+ "model.layers.4.post_attention_layernorm.weight": "model-00010-of-00234.safetensors",
582
+ "model.layers.4.self_attn.kv_a_layernorm.weight": "model-00006-of-00234.safetensors",
583
+ "model.layers.4.self_attn.kv_a_proj_with_mqa.weight": "model-00006-of-00234.safetensors",
584
+ "model.layers.4.self_attn.kv_b_proj.weight": "model-00006-of-00234.safetensors",
585
+ "model.layers.4.self_attn.o_proj.weight": "model-00006-of-00234.safetensors",
586
+ "model.layers.4.self_attn.q_a_layernorm.weight": "model-00006-of-00234.safetensors",
587
+ "model.layers.4.self_attn.q_a_proj.weight": "model-00006-of-00234.safetensors",
588
+ "model.layers.4.self_attn.q_b_proj.weight": "model-00006-of-00234.safetensors",
589
+ "model.layers.40.input_layernorm.weight": "model-00154-of-00234.safetensors",
590
+ "model.layers.40.mlp.gate.e_score_correction_bias": "model-00154-of-00234.safetensors",
591
+ "model.layers.40.mlp.gate.weight": "model-00154-of-00234.safetensors",
592
+ "model.layers.40.mlp.shared_experts.down_proj.weight": "model-00154-of-00234.safetensors",
593
+ "model.layers.40.mlp.shared_experts.gate_proj.weight": "model-00154-of-00234.safetensors",
594
+ "model.layers.40.mlp.shared_experts.up_proj.weight": "model-00154-of-00234.safetensors",
595
+ "model.layers.40.mlp.switch_mlp.down_proj.weight": "model-00153-of-00234.safetensors",
596
+ "model.layers.40.mlp.switch_mlp.gate_proj.weight": "model-00151-of-00234.safetensors",
597
+ "model.layers.40.mlp.switch_mlp.up_proj.weight": "model-00152-of-00234.safetensors",
598
+ "model.layers.40.post_attention_layernorm.weight": "model-00154-of-00234.safetensors",
599
+ "model.layers.40.self_attn.kv_a_layernorm.weight": "model-00150-of-00234.safetensors",
600
+ "model.layers.40.self_attn.kv_a_proj_with_mqa.weight": "model-00150-of-00234.safetensors",
601
+ "model.layers.40.self_attn.kv_b_proj.weight": "model-00150-of-00234.safetensors",
602
+ "model.layers.40.self_attn.o_proj.weight": "model-00150-of-00234.safetensors",
603
+ "model.layers.40.self_attn.q_a_layernorm.weight": "model-00150-of-00234.safetensors",
604
+ "model.layers.40.self_attn.q_a_proj.weight": "model-00150-of-00234.safetensors",
605
+ "model.layers.40.self_attn.q_b_proj.weight": "model-00150-of-00234.safetensors",
606
+ "model.layers.41.input_layernorm.weight": "model-00158-of-00234.safetensors",
607
+ "model.layers.41.mlp.gate.e_score_correction_bias": "model-00158-of-00234.safetensors",
608
+ "model.layers.41.mlp.gate.weight": "model-00158-of-00234.safetensors",
609
+ "model.layers.41.mlp.shared_experts.down_proj.weight": "model-00158-of-00234.safetensors",
610
+ "model.layers.41.mlp.shared_experts.gate_proj.weight": "model-00158-of-00234.safetensors",
611
+ "model.layers.41.mlp.shared_experts.up_proj.weight": "model-00158-of-00234.safetensors",
612
+ "model.layers.41.mlp.switch_mlp.down_proj.weight": "model-00157-of-00234.safetensors",
613
+ "model.layers.41.mlp.switch_mlp.gate_proj.weight": "model-00155-of-00234.safetensors",
614
+ "model.layers.41.mlp.switch_mlp.up_proj.weight": "model-00156-of-00234.safetensors",
615
+ "model.layers.41.post_attention_layernorm.weight": "model-00158-of-00234.safetensors",
616
+ "model.layers.41.self_attn.kv_a_layernorm.weight": "model-00154-of-00234.safetensors",
617
+ "model.layers.41.self_attn.kv_a_proj_with_mqa.weight": "model-00154-of-00234.safetensors",
618
+ "model.layers.41.self_attn.kv_b_proj.weight": "model-00154-of-00234.safetensors",
619
+ "model.layers.41.self_attn.o_proj.weight": "model-00154-of-00234.safetensors",
620
+ "model.layers.41.self_attn.q_a_layernorm.weight": "model-00154-of-00234.safetensors",
621
+ "model.layers.41.self_attn.q_a_proj.weight": "model-00154-of-00234.safetensors",
622
+ "model.layers.41.self_attn.q_b_proj.weight": "model-00154-of-00234.safetensors",
623
+ "model.layers.42.input_layernorm.weight": "model-00162-of-00234.safetensors",
624
+ "model.layers.42.mlp.gate.e_score_correction_bias": "model-00162-of-00234.safetensors",
625
+ "model.layers.42.mlp.gate.weight": "model-00162-of-00234.safetensors",
626
+ "model.layers.42.mlp.shared_experts.down_proj.weight": "model-00162-of-00234.safetensors",
627
+ "model.layers.42.mlp.shared_experts.gate_proj.weight": "model-00162-of-00234.safetensors",
628
+ "model.layers.42.mlp.shared_experts.up_proj.weight": "model-00162-of-00234.safetensors",
629
+ "model.layers.42.mlp.switch_mlp.down_proj.weight": "model-00161-of-00234.safetensors",
630
+ "model.layers.42.mlp.switch_mlp.gate_proj.weight": "model-00159-of-00234.safetensors",
631
+ "model.layers.42.mlp.switch_mlp.up_proj.weight": "model-00160-of-00234.safetensors",
632
+ "model.layers.42.post_attention_layernorm.weight": "model-00162-of-00234.safetensors",
633
+ "model.layers.42.self_attn.kv_a_layernorm.weight": "model-00158-of-00234.safetensors",
634
+ "model.layers.42.self_attn.kv_a_proj_with_mqa.weight": "model-00158-of-00234.safetensors",
635
+ "model.layers.42.self_attn.kv_b_proj.weight": "model-00158-of-00234.safetensors",
636
+ "model.layers.42.self_attn.o_proj.weight": "model-00158-of-00234.safetensors",
637
+ "model.layers.42.self_attn.q_a_layernorm.weight": "model-00158-of-00234.safetensors",
638
+ "model.layers.42.self_attn.q_a_proj.weight": "model-00158-of-00234.safetensors",
639
+ "model.layers.42.self_attn.q_b_proj.weight": "model-00158-of-00234.safetensors",
640
+ "model.layers.43.input_layernorm.weight": "model-00166-of-00234.safetensors",
641
+ "model.layers.43.mlp.gate.e_score_correction_bias": "model-00166-of-00234.safetensors",
642
+ "model.layers.43.mlp.gate.weight": "model-00166-of-00234.safetensors",
643
+ "model.layers.43.mlp.shared_experts.down_proj.weight": "model-00166-of-00234.safetensors",
644
+ "model.layers.43.mlp.shared_experts.gate_proj.weight": "model-00166-of-00234.safetensors",
645
+ "model.layers.43.mlp.shared_experts.up_proj.weight": "model-00166-of-00234.safetensors",
646
+ "model.layers.43.mlp.switch_mlp.down_proj.weight": "model-00165-of-00234.safetensors",
647
+ "model.layers.43.mlp.switch_mlp.gate_proj.weight": "model-00163-of-00234.safetensors",
648
+ "model.layers.43.mlp.switch_mlp.up_proj.weight": "model-00164-of-00234.safetensors",
649
+ "model.layers.43.post_attention_layernorm.weight": "model-00166-of-00234.safetensors",
650
+ "model.layers.43.self_attn.kv_a_layernorm.weight": "model-00162-of-00234.safetensors",
651
+ "model.layers.43.self_attn.kv_a_proj_with_mqa.weight": "model-00162-of-00234.safetensors",
652
+ "model.layers.43.self_attn.kv_b_proj.weight": "model-00162-of-00234.safetensors",
653
+ "model.layers.43.self_attn.o_proj.weight": "model-00162-of-00234.safetensors",
654
+ "model.layers.43.self_attn.q_a_layernorm.weight": "model-00162-of-00234.safetensors",
655
+ "model.layers.43.self_attn.q_a_proj.weight": "model-00162-of-00234.safetensors",
656
+ "model.layers.43.self_attn.q_b_proj.weight": "model-00162-of-00234.safetensors",
657
+ "model.layers.44.input_layernorm.weight": "model-00170-of-00234.safetensors",
658
+ "model.layers.44.mlp.gate.e_score_correction_bias": "model-00170-of-00234.safetensors",
659
+ "model.layers.44.mlp.gate.weight": "model-00170-of-00234.safetensors",
660
+ "model.layers.44.mlp.shared_experts.down_proj.weight": "model-00170-of-00234.safetensors",
661
+ "model.layers.44.mlp.shared_experts.gate_proj.weight": "model-00170-of-00234.safetensors",
662
+ "model.layers.44.mlp.shared_experts.up_proj.weight": "model-00170-of-00234.safetensors",
663
+ "model.layers.44.mlp.switch_mlp.down_proj.weight": "model-00169-of-00234.safetensors",
664
+ "model.layers.44.mlp.switch_mlp.gate_proj.weight": "model-00167-of-00234.safetensors",
665
+ "model.layers.44.mlp.switch_mlp.up_proj.weight": "model-00168-of-00234.safetensors",
666
+ "model.layers.44.post_attention_layernorm.weight": "model-00170-of-00234.safetensors",
667
+ "model.layers.44.self_attn.kv_a_layernorm.weight": "model-00166-of-00234.safetensors",
668
+ "model.layers.44.self_attn.kv_a_proj_with_mqa.weight": "model-00166-of-00234.safetensors",
669
+ "model.layers.44.self_attn.kv_b_proj.weight": "model-00166-of-00234.safetensors",
670
+ "model.layers.44.self_attn.o_proj.weight": "model-00166-of-00234.safetensors",
671
+ "model.layers.44.self_attn.q_a_layernorm.weight": "model-00166-of-00234.safetensors",
672
+ "model.layers.44.self_attn.q_a_proj.weight": "model-00166-of-00234.safetensors",
673
+ "model.layers.44.self_attn.q_b_proj.weight": "model-00166-of-00234.safetensors",
674
+ "model.layers.45.input_layernorm.weight": "model-00174-of-00234.safetensors",
675
+ "model.layers.45.mlp.gate.e_score_correction_bias": "model-00174-of-00234.safetensors",
676
+ "model.layers.45.mlp.gate.weight": "model-00174-of-00234.safetensors",
677
+ "model.layers.45.mlp.shared_experts.down_proj.weight": "model-00174-of-00234.safetensors",
678
+ "model.layers.45.mlp.shared_experts.gate_proj.weight": "model-00174-of-00234.safetensors",
679
+ "model.layers.45.mlp.shared_experts.up_proj.weight": "model-00174-of-00234.safetensors",
680
+ "model.layers.45.mlp.switch_mlp.down_proj.weight": "model-00173-of-00234.safetensors",
681
+ "model.layers.45.mlp.switch_mlp.gate_proj.weight": "model-00171-of-00234.safetensors",
682
+ "model.layers.45.mlp.switch_mlp.up_proj.weight": "model-00172-of-00234.safetensors",
683
+ "model.layers.45.post_attention_layernorm.weight": "model-00174-of-00234.safetensors",
684
+ "model.layers.45.self_attn.kv_a_layernorm.weight": "model-00170-of-00234.safetensors",
685
+ "model.layers.45.self_attn.kv_a_proj_with_mqa.weight": "model-00170-of-00234.safetensors",
686
+ "model.layers.45.self_attn.kv_b_proj.weight": "model-00170-of-00234.safetensors",
687
+ "model.layers.45.self_attn.o_proj.weight": "model-00170-of-00234.safetensors",
688
+ "model.layers.45.self_attn.q_a_layernorm.weight": "model-00170-of-00234.safetensors",
689
+ "model.layers.45.self_attn.q_a_proj.weight": "model-00170-of-00234.safetensors",
690
+ "model.layers.45.self_attn.q_b_proj.weight": "model-00170-of-00234.safetensors",
691
+ "model.layers.46.input_layernorm.weight": "model-00178-of-00234.safetensors",
692
+ "model.layers.46.mlp.gate.e_score_correction_bias": "model-00178-of-00234.safetensors",
693
+ "model.layers.46.mlp.gate.weight": "model-00178-of-00234.safetensors",
694
+ "model.layers.46.mlp.shared_experts.down_proj.weight": "model-00178-of-00234.safetensors",
695
+ "model.layers.46.mlp.shared_experts.gate_proj.weight": "model-00178-of-00234.safetensors",
696
+ "model.layers.46.mlp.shared_experts.up_proj.weight": "model-00178-of-00234.safetensors",
697
+ "model.layers.46.mlp.switch_mlp.down_proj.weight": "model-00177-of-00234.safetensors",
698
+ "model.layers.46.mlp.switch_mlp.gate_proj.weight": "model-00175-of-00234.safetensors",
699
+ "model.layers.46.mlp.switch_mlp.up_proj.weight": "model-00176-of-00234.safetensors",
700
+ "model.layers.46.post_attention_layernorm.weight": "model-00178-of-00234.safetensors",
701
+ "model.layers.46.self_attn.kv_a_layernorm.weight": "model-00174-of-00234.safetensors",
702
+ "model.layers.46.self_attn.kv_a_proj_with_mqa.weight": "model-00174-of-00234.safetensors",
703
+ "model.layers.46.self_attn.kv_b_proj.weight": "model-00174-of-00234.safetensors",
704
+ "model.layers.46.self_attn.o_proj.weight": "model-00174-of-00234.safetensors",
705
+ "model.layers.46.self_attn.q_a_layernorm.weight": "model-00174-of-00234.safetensors",
706
+ "model.layers.46.self_attn.q_a_proj.weight": "model-00174-of-00234.safetensors",
707
+ "model.layers.46.self_attn.q_b_proj.weight": "model-00174-of-00234.safetensors",
708
+ "model.layers.47.input_layernorm.weight": "model-00182-of-00234.safetensors",
709
+ "model.layers.47.mlp.gate.e_score_correction_bias": "model-00182-of-00234.safetensors",
710
+ "model.layers.47.mlp.gate.weight": "model-00182-of-00234.safetensors",
711
+ "model.layers.47.mlp.shared_experts.down_proj.weight": "model-00182-of-00234.safetensors",
712
+ "model.layers.47.mlp.shared_experts.gate_proj.weight": "model-00182-of-00234.safetensors",
713
+ "model.layers.47.mlp.shared_experts.up_proj.weight": "model-00182-of-00234.safetensors",
714
+ "model.layers.47.mlp.switch_mlp.down_proj.weight": "model-00181-of-00234.safetensors",
715
+ "model.layers.47.mlp.switch_mlp.gate_proj.weight": "model-00179-of-00234.safetensors",
716
+ "model.layers.47.mlp.switch_mlp.up_proj.weight": "model-00180-of-00234.safetensors",
717
+ "model.layers.47.post_attention_layernorm.weight": "model-00182-of-00234.safetensors",
718
+ "model.layers.47.self_attn.kv_a_layernorm.weight": "model-00178-of-00234.safetensors",
719
+ "model.layers.47.self_attn.kv_a_proj_with_mqa.weight": "model-00178-of-00234.safetensors",
720
+ "model.layers.47.self_attn.kv_b_proj.weight": "model-00178-of-00234.safetensors",
721
+ "model.layers.47.self_attn.o_proj.weight": "model-00178-of-00234.safetensors",
722
+ "model.layers.47.self_attn.q_a_layernorm.weight": "model-00178-of-00234.safetensors",
723
+ "model.layers.47.self_attn.q_a_proj.weight": "model-00178-of-00234.safetensors",
724
+ "model.layers.47.self_attn.q_b_proj.weight": "model-00178-of-00234.safetensors",
725
+ "model.layers.48.input_layernorm.weight": "model-00186-of-00234.safetensors",
726
+ "model.layers.48.mlp.gate.e_score_correction_bias": "model-00186-of-00234.safetensors",
727
+ "model.layers.48.mlp.gate.weight": "model-00186-of-00234.safetensors",
728
+ "model.layers.48.mlp.shared_experts.down_proj.weight": "model-00186-of-00234.safetensors",
729
+ "model.layers.48.mlp.shared_experts.gate_proj.weight": "model-00186-of-00234.safetensors",
730
+ "model.layers.48.mlp.shared_experts.up_proj.weight": "model-00186-of-00234.safetensors",
731
+ "model.layers.48.mlp.switch_mlp.down_proj.weight": "model-00185-of-00234.safetensors",
732
+ "model.layers.48.mlp.switch_mlp.gate_proj.weight": "model-00183-of-00234.safetensors",
733
+ "model.layers.48.mlp.switch_mlp.up_proj.weight": "model-00184-of-00234.safetensors",
734
+ "model.layers.48.post_attention_layernorm.weight": "model-00186-of-00234.safetensors",
735
+ "model.layers.48.self_attn.kv_a_layernorm.weight": "model-00182-of-00234.safetensors",
736
+ "model.layers.48.self_attn.kv_a_proj_with_mqa.weight": "model-00182-of-00234.safetensors",
737
+ "model.layers.48.self_attn.kv_b_proj.weight": "model-00182-of-00234.safetensors",
738
+ "model.layers.48.self_attn.o_proj.weight": "model-00182-of-00234.safetensors",
739
+ "model.layers.48.self_attn.q_a_layernorm.weight": "model-00182-of-00234.safetensors",
740
+ "model.layers.48.self_attn.q_a_proj.weight": "model-00182-of-00234.safetensors",
741
+ "model.layers.48.self_attn.q_b_proj.weight": "model-00182-of-00234.safetensors",
742
+ "model.layers.49.input_layernorm.weight": "model-00190-of-00234.safetensors",
743
+ "model.layers.49.mlp.gate.e_score_correction_bias": "model-00190-of-00234.safetensors",
744
+ "model.layers.49.mlp.gate.weight": "model-00190-of-00234.safetensors",
745
+ "model.layers.49.mlp.shared_experts.down_proj.weight": "model-00190-of-00234.safetensors",
746
+ "model.layers.49.mlp.shared_experts.gate_proj.weight": "model-00190-of-00234.safetensors",
747
+ "model.layers.49.mlp.shared_experts.up_proj.weight": "model-00190-of-00234.safetensors",
748
+ "model.layers.49.mlp.switch_mlp.down_proj.weight": "model-00189-of-00234.safetensors",
749
+ "model.layers.49.mlp.switch_mlp.gate_proj.weight": "model-00187-of-00234.safetensors",
750
+ "model.layers.49.mlp.switch_mlp.up_proj.weight": "model-00188-of-00234.safetensors",
751
+ "model.layers.49.post_attention_layernorm.weight": "model-00190-of-00234.safetensors",
752
+ "model.layers.49.self_attn.kv_a_layernorm.weight": "model-00186-of-00234.safetensors",
753
+ "model.layers.49.self_attn.kv_a_proj_with_mqa.weight": "model-00186-of-00234.safetensors",
754
+ "model.layers.49.self_attn.kv_b_proj.weight": "model-00186-of-00234.safetensors",
755
+ "model.layers.49.self_attn.o_proj.weight": "model-00186-of-00234.safetensors",
756
+ "model.layers.49.self_attn.q_a_layernorm.weight": "model-00186-of-00234.safetensors",
757
+ "model.layers.49.self_attn.q_a_proj.weight": "model-00186-of-00234.safetensors",
758
+ "model.layers.49.self_attn.q_b_proj.weight": "model-00186-of-00234.safetensors",
759
+ "model.layers.5.input_layernorm.weight": "model-00014-of-00234.safetensors",
760
+ "model.layers.5.mlp.gate.e_score_correction_bias": "model-00014-of-00234.safetensors",
761
+ "model.layers.5.mlp.gate.weight": "model-00014-of-00234.safetensors",
762
+ "model.layers.5.mlp.shared_experts.down_proj.weight": "model-00014-of-00234.safetensors",
763
+ "model.layers.5.mlp.shared_experts.gate_proj.weight": "model-00014-of-00234.safetensors",
764
+ "model.layers.5.mlp.shared_experts.up_proj.weight": "model-00014-of-00234.safetensors",
765
+ "model.layers.5.mlp.switch_mlp.down_proj.weight": "model-00013-of-00234.safetensors",
766
+ "model.layers.5.mlp.switch_mlp.gate_proj.weight": "model-00011-of-00234.safetensors",
767
+ "model.layers.5.mlp.switch_mlp.up_proj.weight": "model-00012-of-00234.safetensors",
768
+ "model.layers.5.post_attention_layernorm.weight": "model-00014-of-00234.safetensors",
769
+ "model.layers.5.self_attn.kv_a_layernorm.weight": "model-00010-of-00234.safetensors",
770
+ "model.layers.5.self_attn.kv_a_proj_with_mqa.weight": "model-00010-of-00234.safetensors",
771
+ "model.layers.5.self_attn.kv_b_proj.weight": "model-00010-of-00234.safetensors",
772
+ "model.layers.5.self_attn.o_proj.weight": "model-00010-of-00234.safetensors",
773
+ "model.layers.5.self_attn.q_a_layernorm.weight": "model-00010-of-00234.safetensors",
774
+ "model.layers.5.self_attn.q_a_proj.weight": "model-00010-of-00234.safetensors",
775
+ "model.layers.5.self_attn.q_b_proj.weight": "model-00010-of-00234.safetensors",
776
+ "model.layers.50.input_layernorm.weight": "model-00194-of-00234.safetensors",
777
+ "model.layers.50.mlp.gate.e_score_correction_bias": "model-00194-of-00234.safetensors",
778
+ "model.layers.50.mlp.gate.weight": "model-00194-of-00234.safetensors",
779
+ "model.layers.50.mlp.shared_experts.down_proj.weight": "model-00194-of-00234.safetensors",
780
+ "model.layers.50.mlp.shared_experts.gate_proj.weight": "model-00194-of-00234.safetensors",
781
+ "model.layers.50.mlp.shared_experts.up_proj.weight": "model-00194-of-00234.safetensors",
782
+ "model.layers.50.mlp.switch_mlp.down_proj.weight": "model-00193-of-00234.safetensors",
783
+ "model.layers.50.mlp.switch_mlp.gate_proj.weight": "model-00191-of-00234.safetensors",
784
+ "model.layers.50.mlp.switch_mlp.up_proj.weight": "model-00192-of-00234.safetensors",
785
+ "model.layers.50.post_attention_layernorm.weight": "model-00194-of-00234.safetensors",
786
+ "model.layers.50.self_attn.kv_a_layernorm.weight": "model-00190-of-00234.safetensors",
787
+ "model.layers.50.self_attn.kv_a_proj_with_mqa.weight": "model-00190-of-00234.safetensors",
788
+ "model.layers.50.self_attn.kv_b_proj.weight": "model-00190-of-00234.safetensors",
789
+ "model.layers.50.self_attn.o_proj.weight": "model-00190-of-00234.safetensors",
790
+ "model.layers.50.self_attn.q_a_layernorm.weight": "model-00190-of-00234.safetensors",
791
+ "model.layers.50.self_attn.q_a_proj.weight": "model-00190-of-00234.safetensors",
792
+ "model.layers.50.self_attn.q_b_proj.weight": "model-00190-of-00234.safetensors",
793
+ "model.layers.51.input_layernorm.weight": "model-00198-of-00234.safetensors",
794
+ "model.layers.51.mlp.gate.e_score_correction_bias": "model-00198-of-00234.safetensors",
795
+ "model.layers.51.mlp.gate.weight": "model-00198-of-00234.safetensors",
796
+ "model.layers.51.mlp.shared_experts.down_proj.weight": "model-00198-of-00234.safetensors",
797
+ "model.layers.51.mlp.shared_experts.gate_proj.weight": "model-00198-of-00234.safetensors",
798
+ "model.layers.51.mlp.shared_experts.up_proj.weight": "model-00198-of-00234.safetensors",
799
+ "model.layers.51.mlp.switch_mlp.down_proj.weight": "model-00197-of-00234.safetensors",
800
+ "model.layers.51.mlp.switch_mlp.gate_proj.weight": "model-00195-of-00234.safetensors",
801
+ "model.layers.51.mlp.switch_mlp.up_proj.weight": "model-00196-of-00234.safetensors",
802
+ "model.layers.51.post_attention_layernorm.weight": "model-00198-of-00234.safetensors",
803
+ "model.layers.51.self_attn.kv_a_layernorm.weight": "model-00194-of-00234.safetensors",
804
+ "model.layers.51.self_attn.kv_a_proj_with_mqa.weight": "model-00194-of-00234.safetensors",
805
+ "model.layers.51.self_attn.kv_b_proj.weight": "model-00194-of-00234.safetensors",
806
+ "model.layers.51.self_attn.o_proj.weight": "model-00194-of-00234.safetensors",
807
+ "model.layers.51.self_attn.q_a_layernorm.weight": "model-00194-of-00234.safetensors",
808
+ "model.layers.51.self_attn.q_a_proj.weight": "model-00194-of-00234.safetensors",
809
+ "model.layers.51.self_attn.q_b_proj.weight": "model-00194-of-00234.safetensors",
810
+ "model.layers.52.input_layernorm.weight": "model-00202-of-00234.safetensors",
811
+ "model.layers.52.mlp.gate.e_score_correction_bias": "model-00202-of-00234.safetensors",
812
+ "model.layers.52.mlp.gate.weight": "model-00202-of-00234.safetensors",
813
+ "model.layers.52.mlp.shared_experts.down_proj.weight": "model-00202-of-00234.safetensors",
814
+ "model.layers.52.mlp.shared_experts.gate_proj.weight": "model-00202-of-00234.safetensors",
815
+ "model.layers.52.mlp.shared_experts.up_proj.weight": "model-00202-of-00234.safetensors",
816
+ "model.layers.52.mlp.switch_mlp.down_proj.weight": "model-00201-of-00234.safetensors",
817
+ "model.layers.52.mlp.switch_mlp.gate_proj.weight": "model-00199-of-00234.safetensors",
818
+ "model.layers.52.mlp.switch_mlp.up_proj.weight": "model-00200-of-00234.safetensors",
819
+ "model.layers.52.post_attention_layernorm.weight": "model-00202-of-00234.safetensors",
820
+ "model.layers.52.self_attn.kv_a_layernorm.weight": "model-00198-of-00234.safetensors",
821
+ "model.layers.52.self_attn.kv_a_proj_with_mqa.weight": "model-00198-of-00234.safetensors",
822
+ "model.layers.52.self_attn.kv_b_proj.weight": "model-00198-of-00234.safetensors",
823
+ "model.layers.52.self_attn.o_proj.weight": "model-00198-of-00234.safetensors",
824
+ "model.layers.52.self_attn.q_a_layernorm.weight": "model-00198-of-00234.safetensors",
825
+ "model.layers.52.self_attn.q_a_proj.weight": "model-00198-of-00234.safetensors",
826
+ "model.layers.52.self_attn.q_b_proj.weight": "model-00198-of-00234.safetensors",
827
+ "model.layers.53.input_layernorm.weight": "model-00206-of-00234.safetensors",
828
+ "model.layers.53.mlp.gate.e_score_correction_bias": "model-00206-of-00234.safetensors",
829
+ "model.layers.53.mlp.gate.weight": "model-00206-of-00234.safetensors",
830
+ "model.layers.53.mlp.shared_experts.down_proj.weight": "model-00206-of-00234.safetensors",
831
+ "model.layers.53.mlp.shared_experts.gate_proj.weight": "model-00206-of-00234.safetensors",
832
+ "model.layers.53.mlp.shared_experts.up_proj.weight": "model-00206-of-00234.safetensors",
833
+ "model.layers.53.mlp.switch_mlp.down_proj.weight": "model-00205-of-00234.safetensors",
834
+ "model.layers.53.mlp.switch_mlp.gate_proj.weight": "model-00203-of-00234.safetensors",
835
+ "model.layers.53.mlp.switch_mlp.up_proj.weight": "model-00204-of-00234.safetensors",
836
+ "model.layers.53.post_attention_layernorm.weight": "model-00206-of-00234.safetensors",
837
+ "model.layers.53.self_attn.kv_a_layernorm.weight": "model-00202-of-00234.safetensors",
838
+ "model.layers.53.self_attn.kv_a_proj_with_mqa.weight": "model-00202-of-00234.safetensors",
839
+ "model.layers.53.self_attn.kv_b_proj.weight": "model-00202-of-00234.safetensors",
840
+ "model.layers.53.self_attn.o_proj.weight": "model-00202-of-00234.safetensors",
841
+ "model.layers.53.self_attn.q_a_layernorm.weight": "model-00202-of-00234.safetensors",
842
+ "model.layers.53.self_attn.q_a_proj.weight": "model-00202-of-00234.safetensors",
843
+ "model.layers.53.self_attn.q_b_proj.weight": "model-00202-of-00234.safetensors",
844
+ "model.layers.54.input_layernorm.weight": "model-00210-of-00234.safetensors",
845
+ "model.layers.54.mlp.gate.e_score_correction_bias": "model-00210-of-00234.safetensors",
846
+ "model.layers.54.mlp.gate.weight": "model-00210-of-00234.safetensors",
847
+ "model.layers.54.mlp.shared_experts.down_proj.weight": "model-00210-of-00234.safetensors",
848
+ "model.layers.54.mlp.shared_experts.gate_proj.weight": "model-00210-of-00234.safetensors",
849
+ "model.layers.54.mlp.shared_experts.up_proj.weight": "model-00210-of-00234.safetensors",
850
+ "model.layers.54.mlp.switch_mlp.down_proj.weight": "model-00209-of-00234.safetensors",
851
+ "model.layers.54.mlp.switch_mlp.gate_proj.weight": "model-00207-of-00234.safetensors",
852
+ "model.layers.54.mlp.switch_mlp.up_proj.weight": "model-00208-of-00234.safetensors",
853
+ "model.layers.54.post_attention_layernorm.weight": "model-00210-of-00234.safetensors",
854
+ "model.layers.54.self_attn.kv_a_layernorm.weight": "model-00206-of-00234.safetensors",
855
+ "model.layers.54.self_attn.kv_a_proj_with_mqa.weight": "model-00206-of-00234.safetensors",
856
+ "model.layers.54.self_attn.kv_b_proj.weight": "model-00206-of-00234.safetensors",
857
+ "model.layers.54.self_attn.o_proj.weight": "model-00206-of-00234.safetensors",
858
+ "model.layers.54.self_attn.q_a_layernorm.weight": "model-00206-of-00234.safetensors",
859
+ "model.layers.54.self_attn.q_a_proj.weight": "model-00206-of-00234.safetensors",
860
+ "model.layers.54.self_attn.q_b_proj.weight": "model-00206-of-00234.safetensors",
861
+ "model.layers.55.input_layernorm.weight": "model-00214-of-00234.safetensors",
862
+ "model.layers.55.mlp.gate.e_score_correction_bias": "model-00214-of-00234.safetensors",
863
+ "model.layers.55.mlp.gate.weight": "model-00214-of-00234.safetensors",
864
+ "model.layers.55.mlp.shared_experts.down_proj.weight": "model-00214-of-00234.safetensors",
865
+ "model.layers.55.mlp.shared_experts.gate_proj.weight": "model-00214-of-00234.safetensors",
866
+ "model.layers.55.mlp.shared_experts.up_proj.weight": "model-00214-of-00234.safetensors",
867
+ "model.layers.55.mlp.switch_mlp.down_proj.weight": "model-00213-of-00234.safetensors",
868
+ "model.layers.55.mlp.switch_mlp.gate_proj.weight": "model-00211-of-00234.safetensors",
869
+ "model.layers.55.mlp.switch_mlp.up_proj.weight": "model-00212-of-00234.safetensors",
870
+ "model.layers.55.post_attention_layernorm.weight": "model-00214-of-00234.safetensors",
871
+ "model.layers.55.self_attn.kv_a_layernorm.weight": "model-00210-of-00234.safetensors",
872
+ "model.layers.55.self_attn.kv_a_proj_with_mqa.weight": "model-00210-of-00234.safetensors",
873
+ "model.layers.55.self_attn.kv_b_proj.weight": "model-00210-of-00234.safetensors",
874
+ "model.layers.55.self_attn.o_proj.weight": "model-00210-of-00234.safetensors",
875
+ "model.layers.55.self_attn.q_a_layernorm.weight": "model-00210-of-00234.safetensors",
876
+ "model.layers.55.self_attn.q_a_proj.weight": "model-00210-of-00234.safetensors",
877
+ "model.layers.55.self_attn.q_b_proj.weight": "model-00210-of-00234.safetensors",
878
+ "model.layers.56.input_layernorm.weight": "model-00218-of-00234.safetensors",
879
+ "model.layers.56.mlp.gate.e_score_correction_bias": "model-00218-of-00234.safetensors",
880
+ "model.layers.56.mlp.gate.weight": "model-00218-of-00234.safetensors",
881
+ "model.layers.56.mlp.shared_experts.down_proj.weight": "model-00218-of-00234.safetensors",
882
+ "model.layers.56.mlp.shared_experts.gate_proj.weight": "model-00218-of-00234.safetensors",
883
+ "model.layers.56.mlp.shared_experts.up_proj.weight": "model-00218-of-00234.safetensors",
884
+ "model.layers.56.mlp.switch_mlp.down_proj.weight": "model-00217-of-00234.safetensors",
885
+ "model.layers.56.mlp.switch_mlp.gate_proj.weight": "model-00215-of-00234.safetensors",
886
+ "model.layers.56.mlp.switch_mlp.up_proj.weight": "model-00216-of-00234.safetensors",
887
+ "model.layers.56.post_attention_layernorm.weight": "model-00218-of-00234.safetensors",
888
+ "model.layers.56.self_attn.kv_a_layernorm.weight": "model-00214-of-00234.safetensors",
889
+ "model.layers.56.self_attn.kv_a_proj_with_mqa.weight": "model-00214-of-00234.safetensors",
890
+ "model.layers.56.self_attn.kv_b_proj.weight": "model-00214-of-00234.safetensors",
891
+ "model.layers.56.self_attn.o_proj.weight": "model-00214-of-00234.safetensors",
892
+ "model.layers.56.self_attn.q_a_layernorm.weight": "model-00214-of-00234.safetensors",
893
+ "model.layers.56.self_attn.q_a_proj.weight": "model-00214-of-00234.safetensors",
894
+ "model.layers.56.self_attn.q_b_proj.weight": "model-00214-of-00234.safetensors",
895
+ "model.layers.57.input_layernorm.weight": "model-00222-of-00234.safetensors",
896
+ "model.layers.57.mlp.gate.e_score_correction_bias": "model-00222-of-00234.safetensors",
897
+ "model.layers.57.mlp.gate.weight": "model-00222-of-00234.safetensors",
898
+ "model.layers.57.mlp.shared_experts.down_proj.weight": "model-00222-of-00234.safetensors",
899
+ "model.layers.57.mlp.shared_experts.gate_proj.weight": "model-00222-of-00234.safetensors",
900
+ "model.layers.57.mlp.shared_experts.up_proj.weight": "model-00222-of-00234.safetensors",
901
+ "model.layers.57.mlp.switch_mlp.down_proj.weight": "model-00221-of-00234.safetensors",
902
+ "model.layers.57.mlp.switch_mlp.gate_proj.weight": "model-00219-of-00234.safetensors",
903
+ "model.layers.57.mlp.switch_mlp.up_proj.weight": "model-00220-of-00234.safetensors",
904
+ "model.layers.57.post_attention_layernorm.weight": "model-00222-of-00234.safetensors",
905
+ "model.layers.57.self_attn.kv_a_layernorm.weight": "model-00218-of-00234.safetensors",
906
+ "model.layers.57.self_attn.kv_a_proj_with_mqa.weight": "model-00218-of-00234.safetensors",
907
+ "model.layers.57.self_attn.kv_b_proj.weight": "model-00218-of-00234.safetensors",
908
+ "model.layers.57.self_attn.o_proj.weight": "model-00218-of-00234.safetensors",
909
+ "model.layers.57.self_attn.q_a_layernorm.weight": "model-00218-of-00234.safetensors",
910
+ "model.layers.57.self_attn.q_a_proj.weight": "model-00218-of-00234.safetensors",
911
+ "model.layers.57.self_attn.q_b_proj.weight": "model-00218-of-00234.safetensors",
912
+ "model.layers.58.input_layernorm.weight": "model-00226-of-00234.safetensors",
913
+ "model.layers.58.mlp.gate.e_score_correction_bias": "model-00226-of-00234.safetensors",
914
+ "model.layers.58.mlp.gate.weight": "model-00226-of-00234.safetensors",
915
+ "model.layers.58.mlp.shared_experts.down_proj.weight": "model-00226-of-00234.safetensors",
916
+ "model.layers.58.mlp.shared_experts.gate_proj.weight": "model-00226-of-00234.safetensors",
917
+ "model.layers.58.mlp.shared_experts.up_proj.weight": "model-00226-of-00234.safetensors",
918
+ "model.layers.58.mlp.switch_mlp.down_proj.weight": "model-00225-of-00234.safetensors",
919
+ "model.layers.58.mlp.switch_mlp.gate_proj.weight": "model-00223-of-00234.safetensors",
920
+ "model.layers.58.mlp.switch_mlp.up_proj.weight": "model-00224-of-00234.safetensors",
921
+ "model.layers.58.post_attention_layernorm.weight": "model-00226-of-00234.safetensors",
922
+ "model.layers.58.self_attn.kv_a_layernorm.weight": "model-00222-of-00234.safetensors",
923
+ "model.layers.58.self_attn.kv_a_proj_with_mqa.weight": "model-00222-of-00234.safetensors",
924
+ "model.layers.58.self_attn.kv_b_proj.weight": "model-00222-of-00234.safetensors",
925
+ "model.layers.58.self_attn.o_proj.weight": "model-00222-of-00234.safetensors",
926
+ "model.layers.58.self_attn.q_a_layernorm.weight": "model-00222-of-00234.safetensors",
927
+ "model.layers.58.self_attn.q_a_proj.weight": "model-00222-of-00234.safetensors",
928
+ "model.layers.58.self_attn.q_b_proj.weight": "model-00222-of-00234.safetensors",
929
+ "model.layers.59.input_layernorm.weight": "model-00230-of-00234.safetensors",
930
+ "model.layers.59.mlp.gate.e_score_correction_bias": "model-00230-of-00234.safetensors",
931
+ "model.layers.59.mlp.gate.weight": "model-00230-of-00234.safetensors",
932
+ "model.layers.59.mlp.shared_experts.down_proj.weight": "model-00230-of-00234.safetensors",
933
+ "model.layers.59.mlp.shared_experts.gate_proj.weight": "model-00230-of-00234.safetensors",
934
+ "model.layers.59.mlp.shared_experts.up_proj.weight": "model-00230-of-00234.safetensors",
935
+ "model.layers.59.mlp.switch_mlp.down_proj.weight": "model-00229-of-00234.safetensors",
936
+ "model.layers.59.mlp.switch_mlp.gate_proj.weight": "model-00227-of-00234.safetensors",
937
+ "model.layers.59.mlp.switch_mlp.up_proj.weight": "model-00228-of-00234.safetensors",
938
+ "model.layers.59.post_attention_layernorm.weight": "model-00230-of-00234.safetensors",
939
+ "model.layers.59.self_attn.kv_a_layernorm.weight": "model-00226-of-00234.safetensors",
940
+ "model.layers.59.self_attn.kv_a_proj_with_mqa.weight": "model-00226-of-00234.safetensors",
941
+ "model.layers.59.self_attn.kv_b_proj.weight": "model-00226-of-00234.safetensors",
942
+ "model.layers.59.self_attn.o_proj.weight": "model-00226-of-00234.safetensors",
943
+ "model.layers.59.self_attn.q_a_layernorm.weight": "model-00226-of-00234.safetensors",
944
+ "model.layers.59.self_attn.q_a_proj.weight": "model-00226-of-00234.safetensors",
945
+ "model.layers.59.self_attn.q_b_proj.weight": "model-00226-of-00234.safetensors",
946
+ "model.layers.6.input_layernorm.weight": "model-00018-of-00234.safetensors",
947
+ "model.layers.6.mlp.gate.e_score_correction_bias": "model-00018-of-00234.safetensors",
948
+ "model.layers.6.mlp.gate.weight": "model-00018-of-00234.safetensors",
949
+ "model.layers.6.mlp.shared_experts.down_proj.weight": "model-00018-of-00234.safetensors",
950
+ "model.layers.6.mlp.shared_experts.gate_proj.weight": "model-00018-of-00234.safetensors",
951
+ "model.layers.6.mlp.shared_experts.up_proj.weight": "model-00018-of-00234.safetensors",
952
+ "model.layers.6.mlp.switch_mlp.down_proj.weight": "model-00017-of-00234.safetensors",
953
+ "model.layers.6.mlp.switch_mlp.gate_proj.weight": "model-00015-of-00234.safetensors",
954
+ "model.layers.6.mlp.switch_mlp.up_proj.weight": "model-00016-of-00234.safetensors",
955
+ "model.layers.6.post_attention_layernorm.weight": "model-00018-of-00234.safetensors",
956
+ "model.layers.6.self_attn.kv_a_layernorm.weight": "model-00014-of-00234.safetensors",
957
+ "model.layers.6.self_attn.kv_a_proj_with_mqa.weight": "model-00014-of-00234.safetensors",
958
+ "model.layers.6.self_attn.kv_b_proj.weight": "model-00014-of-00234.safetensors",
959
+ "model.layers.6.self_attn.o_proj.weight": "model-00014-of-00234.safetensors",
960
+ "model.layers.6.self_attn.q_a_layernorm.weight": "model-00014-of-00234.safetensors",
961
+ "model.layers.6.self_attn.q_a_proj.weight": "model-00014-of-00234.safetensors",
962
+ "model.layers.6.self_attn.q_b_proj.weight": "model-00014-of-00234.safetensors",
963
+ "model.layers.60.input_layernorm.weight": "model-00234-of-00234.safetensors",
964
+ "model.layers.60.mlp.gate.e_score_correction_bias": "model-00234-of-00234.safetensors",
965
+ "model.layers.60.mlp.gate.weight": "model-00234-of-00234.safetensors",
966
+ "model.layers.60.mlp.shared_experts.down_proj.weight": "model-00234-of-00234.safetensors",
967
+ "model.layers.60.mlp.shared_experts.gate_proj.weight": "model-00234-of-00234.safetensors",
968
+ "model.layers.60.mlp.shared_experts.up_proj.weight": "model-00234-of-00234.safetensors",
969
+ "model.layers.60.mlp.switch_mlp.down_proj.weight": "model-00233-of-00234.safetensors",
970
+ "model.layers.60.mlp.switch_mlp.gate_proj.weight": "model-00231-of-00234.safetensors",
971
+ "model.layers.60.mlp.switch_mlp.up_proj.weight": "model-00232-of-00234.safetensors",
972
+ "model.layers.60.post_attention_layernorm.weight": "model-00234-of-00234.safetensors",
973
+ "model.layers.60.self_attn.kv_a_layernorm.weight": "model-00230-of-00234.safetensors",
974
+ "model.layers.60.self_attn.kv_a_proj_with_mqa.weight": "model-00230-of-00234.safetensors",
975
+ "model.layers.60.self_attn.kv_b_proj.weight": "model-00230-of-00234.safetensors",
976
+ "model.layers.60.self_attn.o_proj.weight": "model-00230-of-00234.safetensors",
977
+ "model.layers.60.self_attn.q_a_layernorm.weight": "model-00230-of-00234.safetensors",
978
+ "model.layers.60.self_attn.q_a_proj.weight": "model-00230-of-00234.safetensors",
979
+ "model.layers.60.self_attn.q_b_proj.weight": "model-00230-of-00234.safetensors",
980
+ "model.layers.7.input_layernorm.weight": "model-00022-of-00234.safetensors",
981
+ "model.layers.7.mlp.gate.e_score_correction_bias": "model-00022-of-00234.safetensors",
982
+ "model.layers.7.mlp.gate.weight": "model-00022-of-00234.safetensors",
983
+ "model.layers.7.mlp.shared_experts.down_proj.weight": "model-00022-of-00234.safetensors",
984
+ "model.layers.7.mlp.shared_experts.gate_proj.weight": "model-00022-of-00234.safetensors",
985
+ "model.layers.7.mlp.shared_experts.up_proj.weight": "model-00022-of-00234.safetensors",
986
+ "model.layers.7.mlp.switch_mlp.down_proj.weight": "model-00021-of-00234.safetensors",
987
+ "model.layers.7.mlp.switch_mlp.gate_proj.weight": "model-00019-of-00234.safetensors",
988
+ "model.layers.7.mlp.switch_mlp.up_proj.weight": "model-00020-of-00234.safetensors",
989
+ "model.layers.7.post_attention_layernorm.weight": "model-00022-of-00234.safetensors",
990
+ "model.layers.7.self_attn.kv_a_layernorm.weight": "model-00018-of-00234.safetensors",
991
+ "model.layers.7.self_attn.kv_a_proj_with_mqa.weight": "model-00018-of-00234.safetensors",
992
+ "model.layers.7.self_attn.kv_b_proj.weight": "model-00018-of-00234.safetensors",
993
+ "model.layers.7.self_attn.o_proj.weight": "model-00018-of-00234.safetensors",
994
+ "model.layers.7.self_attn.q_a_layernorm.weight": "model-00018-of-00234.safetensors",
995
+ "model.layers.7.self_attn.q_a_proj.weight": "model-00018-of-00234.safetensors",
996
+ "model.layers.7.self_attn.q_b_proj.weight": "model-00018-of-00234.safetensors",
997
+ "model.layers.8.input_layernorm.weight": "model-00026-of-00234.safetensors",
998
+ "model.layers.8.mlp.gate.e_score_correction_bias": "model-00026-of-00234.safetensors",
999
+ "model.layers.8.mlp.gate.weight": "model-00026-of-00234.safetensors",
1000
+ "model.layers.8.mlp.shared_experts.down_proj.weight": "model-00026-of-00234.safetensors",
1001
+ "model.layers.8.mlp.shared_experts.gate_proj.weight": "model-00026-of-00234.safetensors",
1002
+ "model.layers.8.mlp.shared_experts.up_proj.weight": "model-00026-of-00234.safetensors",
1003
+ "model.layers.8.mlp.switch_mlp.down_proj.weight": "model-00025-of-00234.safetensors",
1004
+ "model.layers.8.mlp.switch_mlp.gate_proj.weight": "model-00023-of-00234.safetensors",
1005
+ "model.layers.8.mlp.switch_mlp.up_proj.weight": "model-00024-of-00234.safetensors",
1006
+ "model.layers.8.post_attention_layernorm.weight": "model-00026-of-00234.safetensors",
1007
+ "model.layers.8.self_attn.kv_a_layernorm.weight": "model-00022-of-00234.safetensors",
1008
+ "model.layers.8.self_attn.kv_a_proj_with_mqa.weight": "model-00022-of-00234.safetensors",
1009
+ "model.layers.8.self_attn.kv_b_proj.weight": "model-00022-of-00234.safetensors",
1010
+ "model.layers.8.self_attn.o_proj.weight": "model-00022-of-00234.safetensors",
1011
+ "model.layers.8.self_attn.q_a_layernorm.weight": "model-00022-of-00234.safetensors",
1012
+ "model.layers.8.self_attn.q_a_proj.weight": "model-00022-of-00234.safetensors",
1013
+ "model.layers.8.self_attn.q_b_proj.weight": "model-00022-of-00234.safetensors",
1014
+ "model.layers.9.input_layernorm.weight": "model-00030-of-00234.safetensors",
1015
+ "model.layers.9.mlp.gate.e_score_correction_bias": "model-00030-of-00234.safetensors",
1016
+ "model.layers.9.mlp.gate.weight": "model-00030-of-00234.safetensors",
1017
+ "model.layers.9.mlp.shared_experts.down_proj.weight": "model-00030-of-00234.safetensors",
1018
+ "model.layers.9.mlp.shared_experts.gate_proj.weight": "model-00030-of-00234.safetensors",
1019
+ "model.layers.9.mlp.shared_experts.up_proj.weight": "model-00030-of-00234.safetensors",
1020
+ "model.layers.9.mlp.switch_mlp.down_proj.weight": "model-00029-of-00234.safetensors",
1021
+ "model.layers.9.mlp.switch_mlp.gate_proj.weight": "model-00027-of-00234.safetensors",
1022
+ "model.layers.9.mlp.switch_mlp.up_proj.weight": "model-00028-of-00234.safetensors",
1023
+ "model.layers.9.post_attention_layernorm.weight": "model-00030-of-00234.safetensors",
1024
+ "model.layers.9.self_attn.kv_a_layernorm.weight": "model-00026-of-00234.safetensors",
1025
+ "model.layers.9.self_attn.kv_a_proj_with_mqa.weight": "model-00026-of-00234.safetensors",
1026
+ "model.layers.9.self_attn.kv_b_proj.weight": "model-00026-of-00234.safetensors",
1027
+ "model.layers.9.self_attn.o_proj.weight": "model-00026-of-00234.safetensors",
1028
+ "model.layers.9.self_attn.q_a_layernorm.weight": "model-00026-of-00234.safetensors",
1029
+ "model.layers.9.self_attn.q_a_proj.weight": "model-00026-of-00234.safetensors",
1030
+ "model.layers.9.self_attn.q_b_proj.weight": "model-00026-of-00234.safetensors",
1031
+ "model.norm.weight": "model-00234-of-00234.safetensors"
1032
+ }
1033
+ }
modeling_deepseek.py ADDED
@@ -0,0 +1,1848 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2023 DeepSeek-AI 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 DeepSeek model."""
21
+ import math
22
+ import warnings
23
+ from typing import List, Optional, Tuple, Union
24
+
25
+ import torch
26
+ import torch.nn.functional as F
27
+ import torch.utils.checkpoint
28
+ from torch import nn
29
+ from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
30
+
31
+ from transformers.activations import ACT2FN
32
+ from transformers.cache_utils import Cache, DynamicCache
33
+ from transformers.modeling_attn_mask_utils import (
34
+ AttentionMaskConverter,
35
+ _prepare_4d_attention_mask,
36
+ _prepare_4d_causal_attention_mask,
37
+ )
38
+ from transformers.modeling_outputs import (
39
+ BaseModelOutputWithPast,
40
+ CausalLMOutputWithPast,
41
+ SequenceClassifierOutputWithPast,
42
+ )
43
+ from transformers.modeling_utils import PreTrainedModel
44
+ from transformers.pytorch_utils import (
45
+ ALL_LAYERNORM_LAYERS,
46
+ is_torch_greater_or_equal_than_1_13,
47
+ )
48
+ from transformers.utils import (
49
+ add_start_docstrings,
50
+ add_start_docstrings_to_model_forward,
51
+ is_flash_attn_2_available,
52
+ is_flash_attn_greater_or_equal_2_10,
53
+ logging,
54
+ replace_return_docstrings,
55
+ )
56
+ from transformers.utils.import_utils import is_torch_fx_available
57
+ from .configuration_deepseek import DeepseekV3Config
58
+ import torch.distributed as dist
59
+ import numpy as np
60
+
61
+ if is_flash_attn_2_available():
62
+ from flash_attn import flash_attn_func, flash_attn_varlen_func
63
+ from flash_attn.bert_padding import index_first_axis, pad_input, unpad_input # noqa
64
+
65
+
66
+ # This makes `_prepare_4d_causal_attention_mask` a leaf function in the FX graph.
67
+ # It means that the function will not be traced through and simply appear as a node in the graph.
68
+ if is_torch_fx_available():
69
+ if not is_torch_greater_or_equal_than_1_13:
70
+ import torch.fx
71
+
72
+ _prepare_4d_causal_attention_mask = torch.fx.wrap(_prepare_4d_causal_attention_mask)
73
+
74
+
75
+ logger = logging.get_logger(__name__)
76
+
77
+ _CONFIG_FOR_DOC = "DeepseekV3Config"
78
+
79
+
80
+ def _get_unpad_data(attention_mask):
81
+ seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32)
82
+ indices = torch.nonzero(attention_mask.flatten(), as_tuple=False).flatten()
83
+ max_seqlen_in_batch = seqlens_in_batch.max().item()
84
+ cu_seqlens = F.pad(
85
+ torch.cumsum(seqlens_in_batch, dim=0, dtype=torch.torch.int32), (1, 0)
86
+ )
87
+ return (
88
+ indices,
89
+ cu_seqlens,
90
+ max_seqlen_in_batch,
91
+ )
92
+
93
+
94
+ class DeepseekV3RMSNorm(nn.Module):
95
+ def __init__(self, hidden_size, eps=1e-6):
96
+ """
97
+ DeepseekV3RMSNorm is equivalent to T5LayerNorm
98
+ """
99
+ super().__init__()
100
+ self.weight = nn.Parameter(torch.ones(hidden_size))
101
+ self.variance_epsilon = eps
102
+
103
+ def forward(self, hidden_states):
104
+ input_dtype = hidden_states.dtype
105
+ hidden_states = hidden_states.to(torch.float32)
106
+ variance = hidden_states.pow(2).mean(-1, keepdim=True)
107
+ hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
108
+ return self.weight * hidden_states.to(input_dtype)
109
+
110
+
111
+ ALL_LAYERNORM_LAYERS.append(DeepseekV3RMSNorm)
112
+
113
+
114
+ class DeepseekV3RotaryEmbedding(nn.Module):
115
+ def __init__(self, dim, max_position_embeddings=2048, base=10000, device=None):
116
+ super().__init__()
117
+
118
+ self.dim = dim
119
+ self.max_position_embeddings = max_position_embeddings
120
+ self.base = base
121
+ inv_freq = 1.0 / (
122
+ self.base ** (torch.arange(0, self.dim, 2).float().to(device) / self.dim)
123
+ )
124
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
125
+
126
+ # Build here to make `torch.jit.trace` work.
127
+ self._set_cos_sin_cache(
128
+ seq_len=max_position_embeddings,
129
+ device=self.inv_freq.device,
130
+ dtype=torch.get_default_dtype(),
131
+ )
132
+ self.max_seq_len_cached = None
133
+
134
+ def _set_cos_sin_cache(self, seq_len, device, dtype):
135
+ self.max_seq_len_cached = seq_len
136
+ t = torch.arange(
137
+ self.max_seq_len_cached, device=device, dtype=self.inv_freq.dtype
138
+ )
139
+
140
+ freqs = torch.outer(t, self.inv_freq.to(t.device))
141
+ # Different from paper, but it uses a different permutation in order to obtain the same calculation
142
+ emb = torch.cat((freqs, freqs), dim=-1)
143
+ self.register_buffer("cos_cached", emb.cos().to(dtype), persistent=False)
144
+ self.register_buffer("sin_cached", emb.sin().to(dtype), persistent=False)
145
+
146
+ def forward(self, x, seq_len=None):
147
+ # x: [bs, num_attention_heads, seq_len, head_size]
148
+ if self.max_seq_len_cached is None or seq_len > self.max_seq_len_cached:
149
+ self._set_cos_sin_cache(seq_len=seq_len, device=x.device, dtype=x.dtype)
150
+
151
+ return (
152
+ self.cos_cached[:seq_len].to(dtype=x.dtype),
153
+ self.sin_cached[:seq_len].to(dtype=x.dtype),
154
+ )
155
+
156
+
157
+ # Copied from transformers.models.llama.modeling_llama.LlamaLinearScalingRotaryEmbedding with Llama->DeepseekV3
158
+ class DeepseekV3LinearScalingRotaryEmbedding(DeepseekV3RotaryEmbedding):
159
+ """DeepseekV3RotaryEmbedding extended with linear scaling. Credits to the Reddit user /u/kaiokendev"""
160
+
161
+ def __init__(
162
+ self,
163
+ dim,
164
+ max_position_embeddings=2048,
165
+ base=10000,
166
+ device=None,
167
+ scaling_factor=1.0,
168
+ ):
169
+ self.scaling_factor = scaling_factor
170
+ super().__init__(dim, max_position_embeddings, base, device)
171
+
172
+ def _set_cos_sin_cache(self, seq_len, device, dtype):
173
+ self.max_seq_len_cached = seq_len
174
+ t = torch.arange(
175
+ self.max_seq_len_cached, device=device, dtype=self.inv_freq.dtype
176
+ )
177
+ t = t / self.scaling_factor
178
+
179
+ freqs = torch.outer(t, self.inv_freq)
180
+ # Different from paper, but it uses a different permutation in order to obtain the same calculation
181
+ emb = torch.cat((freqs, freqs), dim=-1)
182
+ self.register_buffer("cos_cached", emb.cos().to(dtype), persistent=False)
183
+ self.register_buffer("sin_cached", emb.sin().to(dtype), persistent=False)
184
+
185
+
186
+ # Copied from transformers.models.llama.modeling_llama.LlamaDynamicNTKScalingRotaryEmbedding with Llama->DeepseekV3
187
+ class DeepseekV3DynamicNTKScalingRotaryEmbedding(DeepseekV3RotaryEmbedding):
188
+ """DeepseekV3RotaryEmbedding extended with Dynamic NTK scaling. Credits to the Reddit users /u/bloc97 and /u/emozilla"""
189
+
190
+ def __init__(
191
+ self,
192
+ dim,
193
+ max_position_embeddings=2048,
194
+ base=10000,
195
+ device=None,
196
+ scaling_factor=1.0,
197
+ ):
198
+ self.scaling_factor = scaling_factor
199
+ super().__init__(dim, max_position_embeddings, base, device)
200
+
201
+ def _set_cos_sin_cache(self, seq_len, device, dtype):
202
+ self.max_seq_len_cached = seq_len
203
+
204
+ if seq_len > self.max_position_embeddings:
205
+ base = self.base * (
206
+ (self.scaling_factor * seq_len / self.max_position_embeddings)
207
+ - (self.scaling_factor - 1)
208
+ ) ** (self.dim / (self.dim - 2))
209
+ inv_freq = 1.0 / (
210
+ base ** (torch.arange(0, self.dim, 2).float().to(device) / self.dim)
211
+ )
212
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
213
+
214
+ t = torch.arange(
215
+ self.max_seq_len_cached, device=device, dtype=self.inv_freq.dtype
216
+ )
217
+
218
+ freqs = torch.outer(t, self.inv_freq)
219
+ # Different from paper, but it uses a different permutation in order to obtain the same calculation
220
+ emb = torch.cat((freqs, freqs), dim=-1)
221
+ self.register_buffer("cos_cached", emb.cos().to(dtype), persistent=False)
222
+ self.register_buffer("sin_cached", emb.sin().to(dtype), persistent=False)
223
+
224
+
225
+ # Inverse dim formula to find dim based on number of rotations
226
+ def yarn_find_correction_dim(
227
+ num_rotations, dim, base=10000, max_position_embeddings=2048
228
+ ):
229
+ return (dim * math.log(max_position_embeddings / (num_rotations * 2 * math.pi))) / (
230
+ 2 * math.log(base)
231
+ )
232
+
233
+
234
+ # Find dim range bounds based on rotations
235
+ def yarn_find_correction_range(
236
+ low_rot, high_rot, dim, base=10000, max_position_embeddings=2048
237
+ ):
238
+ low = math.floor(
239
+ yarn_find_correction_dim(low_rot, dim, base, max_position_embeddings)
240
+ )
241
+ high = math.ceil(
242
+ yarn_find_correction_dim(high_rot, dim, base, max_position_embeddings)
243
+ )
244
+ return max(low, 0), min(high, dim - 1) # Clamp values just in case
245
+
246
+
247
+ def yarn_get_mscale(scale=1, mscale=1):
248
+ if scale <= 1:
249
+ return 1.0
250
+ return 0.1 * mscale * math.log(scale) + 1.0
251
+
252
+
253
+ def yarn_linear_ramp_mask(min, max, dim):
254
+ if min == max:
255
+ max += 0.001 # Prevent singularity
256
+
257
+ linear_func = (torch.arange(dim, dtype=torch.float32) - min) / (max - min)
258
+ ramp_func = torch.clamp(linear_func, 0, 1)
259
+ return ramp_func
260
+
261
+
262
+ class DeepseekV3YarnRotaryEmbedding(DeepseekV3RotaryEmbedding):
263
+
264
+ def __init__(
265
+ self,
266
+ dim,
267
+ max_position_embeddings=2048,
268
+ base=10000,
269
+ device=None,
270
+ scaling_factor=1.0,
271
+ original_max_position_embeddings=4096,
272
+ beta_fast=32,
273
+ beta_slow=1,
274
+ mscale=1,
275
+ mscale_all_dim=0,
276
+ ):
277
+ self.scaling_factor = scaling_factor
278
+ self.original_max_position_embeddings = original_max_position_embeddings
279
+ self.beta_fast = beta_fast
280
+ self.beta_slow = beta_slow
281
+ self.mscale = mscale
282
+ self.mscale_all_dim = mscale_all_dim
283
+ super().__init__(dim, max_position_embeddings, base, device)
284
+
285
+ def _set_cos_sin_cache(self, seq_len, device, dtype):
286
+ self.max_seq_len_cached = seq_len
287
+ dim = self.dim
288
+
289
+ freq_extra = 1.0 / (
290
+ self.base
291
+ ** (torch.arange(0, dim, 2, dtype=torch.float32, device=device) / dim)
292
+ )
293
+ freq_inter = 1.0 / (
294
+ self.scaling_factor
295
+ * self.base
296
+ ** (torch.arange(0, dim, 2, dtype=torch.float32, device=device) / dim)
297
+ )
298
+
299
+ low, high = yarn_find_correction_range(
300
+ self.beta_fast,
301
+ self.beta_slow,
302
+ dim,
303
+ self.base,
304
+ self.original_max_position_embeddings,
305
+ )
306
+ inv_freq_mask = 1.0 - yarn_linear_ramp_mask(low, high, dim // 2).to(
307
+ device=device, dtype=torch.float32
308
+ )
309
+ inv_freq = freq_inter * (1 - inv_freq_mask) + freq_extra * inv_freq_mask
310
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
311
+
312
+ t = torch.arange(seq_len, device=device, dtype=torch.float32)
313
+
314
+ freqs = torch.outer(t, inv_freq)
315
+
316
+ _mscale = float(
317
+ yarn_get_mscale(self.scaling_factor, self.mscale)
318
+ / yarn_get_mscale(self.scaling_factor, self.mscale_all_dim)
319
+ )
320
+
321
+ emb = torch.cat((freqs, freqs), dim=-1)
322
+ self.register_buffer(
323
+ "cos_cached", (emb.cos() * _mscale).to(dtype), persistent=False
324
+ )
325
+ self.register_buffer(
326
+ "sin_cached", (emb.sin() * _mscale).to(dtype), persistent=False
327
+ )
328
+
329
+
330
+ # Copied from transformers.models.llama.modeling_llama.rotate_half
331
+ def rotate_half(x):
332
+ """Rotates half the hidden dims of the input."""
333
+ x1 = x[..., : x.shape[-1] // 2]
334
+ x2 = x[..., x.shape[-1] // 2 :]
335
+ return torch.cat((-x2, x1), dim=-1)
336
+
337
+
338
+ # Copied from transformers.models.llama.modeling_llama.apply_rotary_pos_emb
339
+ def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1):
340
+ """Applies Rotary Position Embedding to the query and key tensors.
341
+
342
+ Args:
343
+ q (`torch.Tensor`): The query tensor.
344
+ k (`torch.Tensor`): The key tensor.
345
+ cos (`torch.Tensor`): The cosine part of the rotary embedding.
346
+ sin (`torch.Tensor`): The sine part of the rotary embedding.
347
+ position_ids (`torch.Tensor`):
348
+ The position indices of the tokens corresponding to the query and key tensors. For example, this can be
349
+ used to pass offsetted position ids when working with a KV-cache.
350
+ unsqueeze_dim (`int`, *optional*, defaults to 1):
351
+ The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
352
+ sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
353
+ that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
354
+ k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
355
+ cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
356
+ the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
357
+ Returns:
358
+ `tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
359
+ """
360
+ cos = cos[position_ids].unsqueeze(unsqueeze_dim)
361
+ sin = sin[position_ids].unsqueeze(unsqueeze_dim)
362
+
363
+ b, h, s, d = q.shape
364
+ q = q.view(b, h, s, d // 2, 2).transpose(4, 3).reshape(b, h, s, d)
365
+
366
+ b, h, s, d = k.shape
367
+ k = k.view(b, h, s, d // 2, 2).transpose(4, 3).reshape(b, h, s, d)
368
+
369
+ q_embed = (q * cos) + (rotate_half(q) * sin)
370
+ k_embed = (k * cos) + (rotate_half(k) * sin)
371
+ return q_embed, k_embed
372
+
373
+
374
+ class DeepseekV3MLP(nn.Module):
375
+ def __init__(self, config, hidden_size=None, intermediate_size=None):
376
+ super().__init__()
377
+ self.config = config
378
+ self.hidden_size = config.hidden_size if hidden_size is None else hidden_size
379
+ self.intermediate_size = (
380
+ config.intermediate_size if intermediate_size is None else intermediate_size
381
+ )
382
+
383
+ self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
384
+ self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
385
+ self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=False)
386
+ self.act_fn = ACT2FN[config.hidden_act]
387
+
388
+ def forward(self, x):
389
+ down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
390
+ return down_proj
391
+
392
+
393
+ class MoEGate(nn.Module):
394
+ def __init__(self, config):
395
+ super().__init__()
396
+ self.config = config
397
+ self.top_k = config.num_experts_per_tok
398
+ self.n_routed_experts = config.n_routed_experts
399
+ self.routed_scaling_factor = config.routed_scaling_factor
400
+ self.scoring_func = config.scoring_func
401
+ self.topk_method = config.topk_method
402
+ self.n_group = config.n_group
403
+ self.topk_group = config.topk_group
404
+
405
+ # topk selection algorithm
406
+ self.norm_topk_prob = config.norm_topk_prob
407
+ self.gating_dim = config.hidden_size
408
+ self.weight = nn.Parameter(
409
+ torch.empty((self.n_routed_experts, self.gating_dim))
410
+ )
411
+ if self.topk_method == "noaux_tc":
412
+ self.e_score_correction_bias = nn.Parameter(
413
+ torch.empty((self.n_routed_experts))
414
+ )
415
+ self.reset_parameters()
416
+
417
+ def reset_parameters(self) -> None:
418
+ import torch.nn.init as init
419
+
420
+ init.kaiming_uniform_(self.weight, a=math.sqrt(5))
421
+
422
+ def forward(self, hidden_states):
423
+ bsz, seq_len, h = hidden_states.shape
424
+ ### compute gating score
425
+ hidden_states = hidden_states.view(-1, h)
426
+ logits = F.linear(
427
+ hidden_states.type(torch.float32), self.weight.type(torch.float32), None
428
+ )
429
+ if self.scoring_func == "sigmoid":
430
+ scores = logits.sigmoid()
431
+ else:
432
+ raise NotImplementedError(
433
+ f"insupportable scoring function for MoE gating: {self.scoring_func}"
434
+ )
435
+
436
+ ### select top-k experts
437
+ if self.topk_method == "noaux_tc":
438
+ assert not self.training
439
+ scores_for_choice = scores.view(bsz * seq_len, -1) + self.e_score_correction_bias.unsqueeze(0)
440
+ group_scores = (
441
+ scores_for_choice.view(bsz * seq_len, self.n_group, -1).topk(2, dim=-1)[0].sum(dim = -1)
442
+ ) # [n, n_group]
443
+ group_idx = torch.topk(
444
+ group_scores, k=self.topk_group, dim=-1, sorted=False
445
+ )[
446
+ 1
447
+ ] # [n, top_k_group]
448
+ group_mask = torch.zeros_like(group_scores) # [n, n_group]
449
+ group_mask.scatter_(1, group_idx, 1) # [n, n_group]
450
+ score_mask = (
451
+ group_mask.unsqueeze(-1)
452
+ .expand(
453
+ bsz * seq_len, self.n_group, self.n_routed_experts // self.n_group
454
+ )
455
+ .reshape(bsz * seq_len, -1)
456
+ ) # [n, e]
457
+ tmp_scores = scores_for_choice.masked_fill(~score_mask.bool(), float("-inf")) # [n, e]
458
+ _, topk_idx = torch.topk(
459
+ tmp_scores, k=self.top_k, dim=-1, sorted=False
460
+ )
461
+ topk_weight = scores.gather(1, topk_idx)
462
+ else:
463
+ raise NotImplementedError(
464
+ f"insupportable TopK function for MoE gating: {self.topk_method}"
465
+ )
466
+
467
+ ### norm gate to sum 1
468
+ if self.top_k > 1 and self.norm_topk_prob:
469
+ denominator = topk_weight.sum(dim=-1, keepdim=True) + 1e-20
470
+ topk_weight = topk_weight / denominator
471
+ topk_weight = topk_weight * self.routed_scaling_factor # must multiply the scaling factor
472
+
473
+ return topk_idx, topk_weight
474
+
475
+ class DeepseekV3MoE(nn.Module):
476
+ """
477
+ A mixed expert module containing shared experts.
478
+ """
479
+
480
+ def __init__(self, config):
481
+ super().__init__()
482
+ self.config = config
483
+ self.num_experts_per_tok = config.num_experts_per_tok
484
+
485
+ if hasattr(config, "ep_size") and config.ep_size > 1:
486
+ assert config.ep_size == dist.get_world_size()
487
+ self.ep_size = config.ep_size
488
+ self.experts_per_rank = config.n_routed_experts // config.ep_size
489
+ self.ep_rank = dist.get_rank()
490
+ self.experts = nn.ModuleList(
491
+ [
492
+ (
493
+ DeepseekV3MLP(
494
+ config, intermediate_size=config.moe_intermediate_size
495
+ )
496
+ if i >= self.ep_rank * self.experts_per_rank
497
+ and i < (self.ep_rank + 1) * self.experts_per_rank
498
+ else None
499
+ )
500
+ for i in range(config.n_routed_experts)
501
+ ]
502
+ )
503
+ else:
504
+ self.ep_size = 1
505
+ self.experts_per_rank = config.n_routed_experts
506
+ self.ep_rank = 0
507
+ self.experts = nn.ModuleList(
508
+ [
509
+ DeepseekV3MLP(
510
+ config, intermediate_size=config.moe_intermediate_size
511
+ )
512
+ for i in range(config.n_routed_experts)
513
+ ]
514
+ )
515
+ self.gate = MoEGate(config)
516
+ if config.n_shared_experts is not None:
517
+ intermediate_size = config.moe_intermediate_size * config.n_shared_experts
518
+ self.shared_experts = DeepseekV3MLP(
519
+ config=config, intermediate_size=intermediate_size
520
+ )
521
+
522
+ def forward(self, hidden_states):
523
+ identity = hidden_states
524
+ orig_shape = hidden_states.shape
525
+ topk_idx, topk_weight = self.gate(hidden_states)
526
+ hidden_states = hidden_states.view(-1, hidden_states.shape[-1])
527
+ flat_topk_idx = topk_idx.view(-1)
528
+ if not self.training:
529
+ y = self.moe_infer(hidden_states, topk_idx, topk_weight).view(*orig_shape)
530
+ if self.config.n_shared_experts is not None:
531
+ y = y + self.shared_experts(identity)
532
+ return y
533
+
534
+ @torch.no_grad()
535
+ def moe_infer(self, x, topk_ids, topk_weight):
536
+ cnts = topk_ids.new_zeros((topk_ids.shape[0], len(self.experts)))
537
+ cnts.scatter_(1, topk_ids, 1)
538
+ tokens_per_expert = cnts.sum(dim=0)
539
+ idxs = topk_ids.view(-1).argsort()
540
+ sorted_tokens = x[idxs // topk_ids.shape[1]]
541
+ sorted_tokens_shape = sorted_tokens.shape
542
+ if self.ep_size > 1:
543
+ tokens_per_ep_rank = tokens_per_expert.view(self.ep_size, -1).sum(dim=1)
544
+ tokens_per_expert_group = tokens_per_expert.new_empty(
545
+ tokens_per_expert.shape[0]
546
+ )
547
+ dist.all_to_all_single(tokens_per_expert_group, tokens_per_expert)
548
+ output_splits = (
549
+ tokens_per_expert_group.view(self.ep_size, -1)
550
+ .sum(1)
551
+ .cpu()
552
+ .numpy()
553
+ .tolist()
554
+ )
555
+ gathered_tokens = sorted_tokens.new_empty(
556
+ tokens_per_expert_group.sum(dim=0).cpu().item(), sorted_tokens.shape[1]
557
+ )
558
+ input_split_sizes = tokens_per_ep_rank.cpu().numpy().tolist()
559
+ dist.all_to_all(
560
+ list(gathered_tokens.split(output_splits)),
561
+ list(sorted_tokens.split(input_split_sizes)),
562
+ )
563
+ tokens_per_expert_post_gather = tokens_per_expert_group.view(
564
+ self.ep_size, self.experts_per_rank
565
+ ).sum(dim=0)
566
+ gatherd_idxs = np.zeros(shape=(gathered_tokens.shape[0],), dtype=np.int32)
567
+ s = 0
568
+ for i, k in enumerate(tokens_per_expert_group.cpu().numpy()):
569
+ gatherd_idxs[s : s + k] = i % self.experts_per_rank
570
+ s += k
571
+ gatherd_idxs = gatherd_idxs.argsort()
572
+ sorted_tokens = gathered_tokens[gatherd_idxs]
573
+ tokens_per_expert = tokens_per_expert_post_gather
574
+ tokens_per_expert = tokens_per_expert.cpu().numpy()
575
+
576
+ outputs = []
577
+ start_idx = 0
578
+ for i, num_tokens in enumerate(tokens_per_expert):
579
+ end_idx = start_idx + num_tokens
580
+ if num_tokens == 0:
581
+ continue
582
+ expert = self.experts[i + self.ep_rank * self.experts_per_rank]
583
+ tokens_for_this_expert = sorted_tokens[start_idx:end_idx]
584
+ expert_out = expert(tokens_for_this_expert)
585
+ outputs.append(expert_out)
586
+ start_idx = end_idx
587
+
588
+ outs = torch.cat(outputs, dim=0) if len(outputs) else sorted_tokens.new_empty(0)
589
+ if self.ep_size > 1:
590
+ new_x = torch.empty_like(outs)
591
+ new_x[gatherd_idxs] = outs
592
+ gathered_tokens = new_x.new_empty(*sorted_tokens_shape)
593
+ dist.all_to_all(
594
+ list(gathered_tokens.split(input_split_sizes)),
595
+ list(new_x.split(output_splits)),
596
+ )
597
+ outs = gathered_tokens
598
+
599
+ new_x = torch.empty_like(outs)
600
+ new_x[idxs] = outs
601
+ final_out = (
602
+ new_x.view(*topk_ids.shape, -1)
603
+ .type(topk_weight.dtype)
604
+ .mul_(topk_weight.unsqueeze(dim=-1))
605
+ .sum(dim=1)
606
+ .type(new_x.dtype)
607
+ )
608
+ return final_out
609
+
610
+
611
+ # Copied from transformers.models.llama.modeling_llama.repeat_kv
612
+ def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
613
+ """
614
+ This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
615
+ num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
616
+ """
617
+ batch, num_key_value_heads, slen, head_dim = hidden_states.shape
618
+ if n_rep == 1:
619
+ return hidden_states
620
+ hidden_states = hidden_states[:, :, None, :, :].expand(
621
+ batch, num_key_value_heads, n_rep, slen, head_dim
622
+ )
623
+ return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
624
+
625
+
626
+ # Copied from transformers.models.llama.modeling_llama.LlamaAttention with Llama->DeepseekV3
627
+ class DeepseekV3Attention(nn.Module):
628
+ """Multi-headed attention from 'Attention Is All You Need' paper"""
629
+
630
+ def __init__(self, config: DeepseekV3Config, layer_idx: Optional[int] = None):
631
+ super().__init__()
632
+ self.config = config
633
+ self.layer_idx = layer_idx
634
+ if layer_idx is None:
635
+ logger.warning_once(
636
+ f"Instantiating {self.__class__.__name__} without passing `layer_idx` is not recommended and will "
637
+ "to errors during the forward call, if caching is used. Please make sure to provide a `layer_idx` "
638
+ "when creating this class."
639
+ )
640
+
641
+ self.attention_dropout = config.attention_dropout
642
+ self.hidden_size = config.hidden_size
643
+ self.num_heads = config.num_attention_heads
644
+
645
+ self.max_position_embeddings = config.max_position_embeddings
646
+ self.rope_theta = config.rope_theta
647
+ self.q_lora_rank = config.q_lora_rank
648
+ self.qk_rope_head_dim = config.qk_rope_head_dim
649
+ self.kv_lora_rank = config.kv_lora_rank
650
+ self.v_head_dim = config.v_head_dim
651
+ self.qk_nope_head_dim = config.qk_nope_head_dim
652
+ self.q_head_dim = config.qk_nope_head_dim + config.qk_rope_head_dim
653
+
654
+ self.is_causal = True
655
+
656
+ if self.q_lora_rank is None:
657
+ self.q_proj = nn.Linear(
658
+ self.hidden_size, self.num_heads * self.q_head_dim, bias=False
659
+ )
660
+ else:
661
+ self.q_a_proj = nn.Linear(
662
+ self.hidden_size, config.q_lora_rank, bias=config.attention_bias
663
+ )
664
+ self.q_a_layernorm = DeepseekV3RMSNorm(config.q_lora_rank)
665
+ self.q_b_proj = nn.Linear(
666
+ config.q_lora_rank, self.num_heads * self.q_head_dim, bias=False
667
+ )
668
+
669
+ self.kv_a_proj_with_mqa = nn.Linear(
670
+ self.hidden_size,
671
+ config.kv_lora_rank + config.qk_rope_head_dim,
672
+ bias=config.attention_bias,
673
+ )
674
+ self.kv_a_layernorm = DeepseekV3RMSNorm(config.kv_lora_rank)
675
+ self.kv_b_proj = nn.Linear(
676
+ config.kv_lora_rank,
677
+ self.num_heads
678
+ * (self.q_head_dim - self.qk_rope_head_dim + self.v_head_dim),
679
+ bias=False,
680
+ )
681
+
682
+ self.o_proj = nn.Linear(
683
+ self.num_heads * self.v_head_dim,
684
+ self.hidden_size,
685
+ bias=config.attention_bias,
686
+ )
687
+ self._init_rope()
688
+
689
+ self.softmax_scale = self.q_head_dim ** (-0.5)
690
+ if self.config.rope_scaling is not None:
691
+ mscale_all_dim = self.config.rope_scaling.get("mscale_all_dim", 0)
692
+ scaling_factor = self.config.rope_scaling["factor"]
693
+ if mscale_all_dim:
694
+ mscale = yarn_get_mscale(scaling_factor, mscale_all_dim)
695
+ self.softmax_scale = self.softmax_scale * mscale * mscale
696
+
697
+ def _init_rope(self):
698
+ if self.config.rope_scaling is None:
699
+ self.rotary_emb = DeepseekV3RotaryEmbedding(
700
+ self.qk_rope_head_dim,
701
+ max_position_embeddings=self.max_position_embeddings,
702
+ base=self.rope_theta,
703
+ )
704
+ else:
705
+ scaling_type = self.config.rope_scaling["type"]
706
+ scaling_factor = self.config.rope_scaling["factor"]
707
+ if scaling_type == "linear":
708
+ self.rotary_emb = DeepseekV3LinearScalingRotaryEmbedding(
709
+ self.qk_rope_head_dim,
710
+ max_position_embeddings=self.max_position_embeddings,
711
+ scaling_factor=scaling_factor,
712
+ base=self.rope_theta,
713
+ )
714
+ elif scaling_type == "dynamic":
715
+ self.rotary_emb = DeepseekV3DynamicNTKScalingRotaryEmbedding(
716
+ self.qk_rope_head_dim,
717
+ max_position_embeddings=self.max_position_embeddings,
718
+ scaling_factor=scaling_factor,
719
+ base=self.rope_theta,
720
+ )
721
+ elif scaling_type == "yarn":
722
+ kwargs = {
723
+ key: self.config.rope_scaling[key]
724
+ for key in [
725
+ "original_max_position_embeddings",
726
+ "beta_fast",
727
+ "beta_slow",
728
+ "mscale",
729
+ "mscale_all_dim",
730
+ ]
731
+ if key in self.config.rope_scaling
732
+ }
733
+ self.rotary_emb = DeepseekV3YarnRotaryEmbedding(
734
+ self.qk_rope_head_dim,
735
+ max_position_embeddings=self.max_position_embeddings,
736
+ scaling_factor=scaling_factor,
737
+ base=self.rope_theta,
738
+ **kwargs,
739
+ )
740
+ else:
741
+ raise ValueError(f"Unknown RoPE scaling type {scaling_type}")
742
+
743
+ def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
744
+ return (
745
+ tensor.view(bsz, seq_len, self.num_heads, self.v_head_dim)
746
+ .transpose(1, 2)
747
+ .contiguous()
748
+ )
749
+
750
+ def forward(
751
+ self,
752
+ hidden_states: torch.Tensor,
753
+ attention_mask: Optional[torch.Tensor] = None,
754
+ position_ids: Optional[torch.LongTensor] = None,
755
+ past_key_value: Optional[Cache] = None,
756
+ output_attentions: bool = False,
757
+ use_cache: bool = False,
758
+ **kwargs,
759
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
760
+ if "padding_mask" in kwargs:
761
+ warnings.warn(
762
+ "Passing `padding_mask` is deprecated and will be removed in v4.37. Please make sure use `attention_mask` instead.`"
763
+ )
764
+ bsz, q_len, _ = hidden_states.size()
765
+
766
+ if self.q_lora_rank is None:
767
+ q = self.q_proj(hidden_states)
768
+ else:
769
+ q = self.q_b_proj(self.q_a_layernorm(self.q_a_proj(hidden_states)))
770
+ q = q.view(bsz, q_len, self.num_heads, self.q_head_dim).transpose(1, 2)
771
+ q_nope, q_pe = torch.split(
772
+ q, [self.qk_nope_head_dim, self.qk_rope_head_dim], dim=-1
773
+ )
774
+
775
+ compressed_kv = self.kv_a_proj_with_mqa(hidden_states)
776
+ compressed_kv, k_pe = torch.split(
777
+ compressed_kv, [self.kv_lora_rank, self.qk_rope_head_dim], dim=-1
778
+ )
779
+ k_pe = k_pe.view(bsz, q_len, 1, self.qk_rope_head_dim).transpose(1, 2)
780
+ kv = (
781
+ self.kv_b_proj(self.kv_a_layernorm(compressed_kv))
782
+ .view(bsz, q_len, self.num_heads, self.qk_nope_head_dim + self.v_head_dim)
783
+ .transpose(1, 2)
784
+ )
785
+
786
+ k_nope, value_states = torch.split(
787
+ kv, [self.qk_nope_head_dim, self.v_head_dim], dim=-1
788
+ )
789
+ kv_seq_len = value_states.shape[-2]
790
+ if past_key_value is not None:
791
+ if self.layer_idx is None:
792
+ raise ValueError(
793
+ f"The cache structure has changed since version v4.36. If you are using {self.__class__.__name__} "
794
+ "for auto-regressive decoding with k/v caching, please make sure to initialize the attention class "
795
+ "with a layer index."
796
+ )
797
+ kv_seq_len += past_key_value.get_usable_length(kv_seq_len, self.layer_idx)
798
+ cos, sin = self.rotary_emb(value_states, seq_len=kv_seq_len)
799
+
800
+ q_pe, k_pe = apply_rotary_pos_emb(q_pe, k_pe, cos, sin, position_ids)
801
+
802
+ query_states = k_pe.new_empty(bsz, self.num_heads, q_len, self.q_head_dim)
803
+ query_states[:, :, :, : self.qk_nope_head_dim] = q_nope
804
+ query_states[:, :, :, self.qk_nope_head_dim :] = q_pe
805
+
806
+ key_states = k_pe.new_empty(bsz, self.num_heads, q_len, self.q_head_dim)
807
+ key_states[:, :, :, : self.qk_nope_head_dim] = k_nope
808
+ key_states[:, :, :, self.qk_nope_head_dim :] = k_pe
809
+ if past_key_value is not None:
810
+ cache_kwargs = {"sin": sin, "cos": cos} # Specific to RoPE models
811
+ key_states, value_states = past_key_value.update(
812
+ key_states, value_states, self.layer_idx, cache_kwargs
813
+ )
814
+
815
+ attn_weights = (
816
+ torch.matmul(query_states, key_states.transpose(2, 3)) * self.softmax_scale
817
+ )
818
+
819
+ if attn_weights.size() != (bsz, self.num_heads, q_len, kv_seq_len):
820
+ raise ValueError(
821
+ f"Attention weights should be of size {(bsz, self.num_heads, q_len, kv_seq_len)}, but is"
822
+ f" {attn_weights.size()}"
823
+ )
824
+ assert attention_mask is not None
825
+ if attention_mask is not None:
826
+ if attention_mask.size() != (bsz, 1, q_len, kv_seq_len):
827
+ raise ValueError(
828
+ f"Attention mask should be of size {(bsz, 1, q_len, kv_seq_len)}, but is {attention_mask.size()}"
829
+ )
830
+ attn_weights = attn_weights + attention_mask
831
+
832
+ # upcast attention to fp32
833
+ attn_weights = nn.functional.softmax(
834
+ attn_weights, dim=-1, dtype=torch.float32
835
+ ).to(query_states.dtype)
836
+ attn_weights = nn.functional.dropout(
837
+ attn_weights, p=self.attention_dropout, training=self.training
838
+ )
839
+ attn_output = torch.matmul(attn_weights, value_states)
840
+
841
+ if attn_output.size() != (bsz, self.num_heads, q_len, self.v_head_dim):
842
+ raise ValueError(
843
+ f"`attn_output` should be of size {(bsz, self.num_heads, q_len, self.v_head_dim)}, but is"
844
+ f" {attn_output.size()}"
845
+ )
846
+
847
+ attn_output = attn_output.transpose(1, 2).contiguous()
848
+
849
+ attn_output = attn_output.reshape(bsz, q_len, self.num_heads * self.v_head_dim)
850
+
851
+ attn_output = self.o_proj(attn_output)
852
+
853
+ if not output_attentions:
854
+ attn_weights = None
855
+
856
+ return attn_output, attn_weights, past_key_value
857
+
858
+
859
+ # Copied from transformers.models.llama.modeling_llama.LlamaFlashAttention2 with Llama->DeepseekV3
860
+ class DeepseekV3FlashAttention2(DeepseekV3Attention):
861
+ """
862
+ DeepseekV3 flash attention module. This module inherits from `DeepseekV3Attention` as the weights of the module stays
863
+ untouched. The only required change would be on the forward pass where it needs to correctly call the public API of
864
+ flash attention and deal with padding tokens in case the input contains any of them.
865
+ """
866
+
867
+ def __init__(self, *args, **kwargs):
868
+ super().__init__(*args, **kwargs)
869
+
870
+ # TODO: Should be removed once Flash Attention for RoCm is bumped to 2.1.
871
+ # 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.
872
+ # 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).
873
+ self._flash_attn_uses_top_left_mask = not is_flash_attn_greater_or_equal_2_10()
874
+
875
+ def forward(
876
+ self,
877
+ hidden_states: torch.Tensor,
878
+ attention_mask: Optional[torch.LongTensor] = None,
879
+ position_ids: Optional[torch.LongTensor] = None,
880
+ past_key_value: Optional[Cache] = None,
881
+ output_attentions: bool = False,
882
+ use_cache: bool = False,
883
+ **kwargs,
884
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
885
+ # DeepseekV3FlashAttention2 attention does not support output_attentions
886
+ if "padding_mask" in kwargs:
887
+ warnings.warn(
888
+ "Passing `padding_mask` is deprecated and will be removed in v4.37. Please make sure use `attention_mask` instead.`"
889
+ )
890
+
891
+ # overwrite attention_mask with padding_mask
892
+ attention_mask = kwargs.pop("padding_mask")
893
+
894
+ output_attentions = False
895
+
896
+ bsz, q_len, _ = hidden_states.size()
897
+
898
+ if self.q_lora_rank is None:
899
+ q = self.q_proj(hidden_states)
900
+ else:
901
+ q = self.q_b_proj(self.q_a_layernorm(self.q_a_proj(hidden_states)))
902
+ q = q.view(bsz, q_len, self.num_heads, self.q_head_dim).transpose(1, 2)
903
+ q_nope, q_pe = torch.split(
904
+ q, [self.qk_nope_head_dim, self.qk_rope_head_dim], dim=-1
905
+ )
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
+ compressed_kv = self.kv_a_proj_with_mqa(hidden_states)
911
+ compressed_kv, k_pe = torch.split(
912
+ compressed_kv, [self.kv_lora_rank, self.qk_rope_head_dim], dim=-1
913
+ )
914
+ k_pe = k_pe.view(bsz, q_len, 1, self.qk_rope_head_dim).transpose(1, 2)
915
+ kv = (
916
+ self.kv_b_proj(self.kv_a_layernorm(compressed_kv))
917
+ .view(bsz, q_len, self.num_heads, self.qk_nope_head_dim + self.v_head_dim)
918
+ .transpose(1, 2)
919
+ )
920
+
921
+ k_nope, value_states = torch.split(
922
+ kv, [self.qk_nope_head_dim, self.v_head_dim], dim=-1
923
+ )
924
+ kv_seq_len = value_states.shape[-2]
925
+
926
+ kv_seq_len = value_states.shape[-2]
927
+ if past_key_value is not None:
928
+ kv_seq_len += past_key_value.get_usable_length(kv_seq_len, self.layer_idx)
929
+
930
+ cos, sin = self.rotary_emb(value_states, seq_len=kv_seq_len)
931
+ q_pe, k_pe = apply_rotary_pos_emb(q_pe, k_pe, cos, sin, position_ids)
932
+
933
+ query_states = k_pe.new_empty(bsz, self.num_heads, q_len, self.q_head_dim)
934
+ query_states[:, :, :, : self.qk_nope_head_dim] = q_nope
935
+ query_states[:, :, :, self.qk_nope_head_dim :] = q_pe
936
+
937
+ key_states = k_pe.new_empty(bsz, self.num_heads, q_len, self.q_head_dim)
938
+ key_states[:, :, :, : self.qk_nope_head_dim] = k_nope
939
+ key_states[:, :, :, self.qk_nope_head_dim :] = k_pe
940
+
941
+ if self.q_head_dim != self.v_head_dim:
942
+ value_states = F.pad(value_states, [0, self.q_head_dim - self.v_head_dim])
943
+
944
+ if past_key_value is not None:
945
+ cache_kwargs = {"sin": sin, "cos": cos} # Specific to RoPE models
946
+ key_states, value_states = past_key_value.update(
947
+ key_states, value_states, self.layer_idx, cache_kwargs
948
+ )
949
+
950
+ # 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
951
+ # to be able to avoid many of these transpose/reshape/view.
952
+ query_states = query_states.transpose(1, 2)
953
+ key_states = key_states.transpose(1, 2)
954
+ value_states = value_states.transpose(1, 2)
955
+
956
+ dropout_rate = self.attention_dropout if self.training else 0.0
957
+
958
+ # In PEFT, usually we cast the layer norms in float32 for training stability reasons
959
+ # therefore the input hidden states gets silently casted in float32. Hence, we need
960
+ # cast them back in the correct dtype just to be sure everything works as expected.
961
+ # This might slowdown training & inference so it is recommended to not cast the LayerNorms
962
+ # in fp32. (DeepseekV3RMSNorm handles it correctly)
963
+
964
+ input_dtype = query_states.dtype
965
+ if input_dtype == torch.float32:
966
+ # Handle the case where the model is quantized
967
+ if hasattr(self.config, "_pre_quantization_dtype"):
968
+ target_dtype = self.config._pre_quantization_dtype
969
+ elif torch.is_autocast_enabled():
970
+ target_dtype = torch.get_autocast_gpu_dtype()
971
+ else:
972
+ target_dtype = (
973
+ self.q_proj.weight.dtype
974
+ if self.q_lora_rank is None
975
+ else self.q_a_proj.weight.dtype
976
+ )
977
+
978
+ logger.warning_once(
979
+ f"The input hidden states seems to be silently casted in float32, this might be related to"
980
+ f" the fact you have upcasted embedding or layer norm layers in float32. We will cast back the input in"
981
+ f" {target_dtype}."
982
+ )
983
+
984
+ query_states = query_states.to(target_dtype)
985
+ key_states = key_states.to(target_dtype)
986
+ value_states = value_states.to(target_dtype)
987
+
988
+ attn_output = self._flash_attention_forward(
989
+ query_states,
990
+ key_states,
991
+ value_states,
992
+ attention_mask,
993
+ q_len,
994
+ dropout=dropout_rate,
995
+ softmax_scale=self.softmax_scale,
996
+ )
997
+ if self.q_head_dim != self.v_head_dim:
998
+ attn_output = attn_output[:, :, :, : self.v_head_dim]
999
+
1000
+ attn_output = attn_output.reshape(
1001
+ bsz, q_len, self.num_heads * self.v_head_dim
1002
+ ).contiguous()
1003
+ attn_output = self.o_proj(attn_output)
1004
+
1005
+ if not output_attentions:
1006
+ attn_weights = None
1007
+
1008
+ return attn_output, attn_weights, past_key_value
1009
+
1010
+ def _flash_attention_forward(
1011
+ self,
1012
+ query_states,
1013
+ key_states,
1014
+ value_states,
1015
+ attention_mask,
1016
+ query_length,
1017
+ dropout=0.0,
1018
+ softmax_scale=None,
1019
+ ):
1020
+ """
1021
+ Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token
1022
+ first unpad the input, then computes the attention scores and pad the final attention scores.
1023
+
1024
+ Args:
1025
+ query_states (`torch.Tensor`):
1026
+ Input query states to be passed to Flash Attention API
1027
+ key_states (`torch.Tensor`):
1028
+ Input key states to be passed to Flash Attention API
1029
+ value_states (`torch.Tensor`):
1030
+ Input value states to be passed to Flash Attention API
1031
+ attention_mask (`torch.Tensor`):
1032
+ The padding mask - corresponds to a tensor of size `(batch_size, seq_len)` where 0 stands for the
1033
+ position of padding tokens and 1 for the position of non-padding tokens.
1034
+ dropout (`int`, *optional*):
1035
+ Attention dropout
1036
+ softmax_scale (`float`, *optional*):
1037
+ The scaling of QK^T before applying softmax. Default to 1 / sqrt(head_dim)
1038
+ """
1039
+ if not self._flash_attn_uses_top_left_mask:
1040
+ causal = self.is_causal
1041
+ else:
1042
+ # TODO: Remove the `query_length != 1` check once Flash Attention for RoCm is bumped to 2.1. For details, please see the comment in DeepseekV3FlashAttention2 __init__.
1043
+ causal = self.is_causal and query_length != 1
1044
+
1045
+ # Contains at least one padding token in the sequence
1046
+ if attention_mask is not None:
1047
+ batch_size = query_states.shape[0]
1048
+ (
1049
+ query_states,
1050
+ key_states,
1051
+ value_states,
1052
+ indices_q,
1053
+ cu_seq_lens,
1054
+ max_seq_lens,
1055
+ ) = self._upad_input(
1056
+ query_states, key_states, value_states, attention_mask, query_length
1057
+ )
1058
+
1059
+ cu_seqlens_q, cu_seqlens_k = cu_seq_lens
1060
+ max_seqlen_in_batch_q, max_seqlen_in_batch_k = max_seq_lens
1061
+
1062
+ attn_output_unpad = flash_attn_varlen_func(
1063
+ query_states,
1064
+ key_states,
1065
+ value_states,
1066
+ cu_seqlens_q=cu_seqlens_q,
1067
+ cu_seqlens_k=cu_seqlens_k,
1068
+ max_seqlen_q=max_seqlen_in_batch_q,
1069
+ max_seqlen_k=max_seqlen_in_batch_k,
1070
+ dropout_p=dropout,
1071
+ softmax_scale=softmax_scale,
1072
+ causal=causal,
1073
+ )
1074
+
1075
+ attn_output = pad_input(
1076
+ attn_output_unpad, indices_q, batch_size, query_length
1077
+ )
1078
+ else:
1079
+ attn_output = flash_attn_func(
1080
+ query_states,
1081
+ key_states,
1082
+ value_states,
1083
+ dropout,
1084
+ softmax_scale=softmax_scale,
1085
+ causal=causal,
1086
+ )
1087
+
1088
+ return attn_output
1089
+
1090
+ def _upad_input(
1091
+ self, query_layer, key_layer, value_layer, attention_mask, query_length
1092
+ ):
1093
+ indices_k, cu_seqlens_k, max_seqlen_in_batch_k = _get_unpad_data(attention_mask)
1094
+ batch_size, kv_seq_len, num_key_value_heads, head_dim = key_layer.shape
1095
+
1096
+ key_layer = index_first_axis(
1097
+ key_layer.reshape(batch_size * kv_seq_len, num_key_value_heads, head_dim),
1098
+ indices_k,
1099
+ )
1100
+ value_layer = index_first_axis(
1101
+ value_layer.reshape(batch_size * kv_seq_len, num_key_value_heads, head_dim),
1102
+ indices_k,
1103
+ )
1104
+ if query_length == kv_seq_len:
1105
+ query_layer = index_first_axis(
1106
+ query_layer.reshape(batch_size * kv_seq_len, self.num_heads, head_dim),
1107
+ indices_k,
1108
+ )
1109
+ cu_seqlens_q = cu_seqlens_k
1110
+ max_seqlen_in_batch_q = max_seqlen_in_batch_k
1111
+ indices_q = indices_k
1112
+ elif query_length == 1:
1113
+ max_seqlen_in_batch_q = 1
1114
+ cu_seqlens_q = torch.arange(
1115
+ batch_size + 1, dtype=torch.int32, device=query_layer.device
1116
+ ) # There is a memcpy here, that is very bad.
1117
+ indices_q = cu_seqlens_q[:-1]
1118
+ query_layer = query_layer.squeeze(1)
1119
+ else:
1120
+ # The -q_len: slice assumes left padding.
1121
+ attention_mask = attention_mask[:, -query_length:]
1122
+ query_layer, indices_q, cu_seqlens_q, max_seqlen_in_batch_q = unpad_input(
1123
+ query_layer, attention_mask
1124
+ )
1125
+
1126
+ return (
1127
+ query_layer,
1128
+ key_layer,
1129
+ value_layer,
1130
+ indices_q,
1131
+ (cu_seqlens_q, cu_seqlens_k),
1132
+ (max_seqlen_in_batch_q, max_seqlen_in_batch_k),
1133
+ )
1134
+
1135
+
1136
+ ATTENTION_CLASSES = {
1137
+ "eager": DeepseekV3Attention,
1138
+ "flash_attention_2": DeepseekV3FlashAttention2,
1139
+ }
1140
+
1141
+
1142
+ class DeepseekV3DecoderLayer(nn.Module):
1143
+ def __init__(self, config: DeepseekV3Config, layer_idx: int):
1144
+ super().__init__()
1145
+ self.hidden_size = config.hidden_size
1146
+
1147
+ self.self_attn = ATTENTION_CLASSES[config._attn_implementation](
1148
+ config=config, layer_idx=layer_idx
1149
+ )
1150
+
1151
+ self.mlp = (
1152
+ DeepseekV3MoE(config)
1153
+ if (
1154
+ config.n_routed_experts is not None
1155
+ and layer_idx >= config.first_k_dense_replace
1156
+ and layer_idx % config.moe_layer_freq == 0
1157
+ )
1158
+ else DeepseekV3MLP(config)
1159
+ )
1160
+ self.input_layernorm = DeepseekV3RMSNorm(
1161
+ config.hidden_size, eps=config.rms_norm_eps
1162
+ )
1163
+ self.post_attention_layernorm = DeepseekV3RMSNorm(
1164
+ config.hidden_size, eps=config.rms_norm_eps
1165
+ )
1166
+
1167
+ def forward(
1168
+ self,
1169
+ hidden_states: torch.Tensor,
1170
+ attention_mask: Optional[torch.Tensor] = None,
1171
+ position_ids: Optional[torch.LongTensor] = None,
1172
+ past_key_value: Optional[Tuple[torch.Tensor]] = None,
1173
+ output_attentions: Optional[bool] = False,
1174
+ use_cache: Optional[bool] = False,
1175
+ **kwargs,
1176
+ ) -> Tuple[
1177
+ torch.FloatTensor, Optional[Tuple[torch.FloatTensor, torch.FloatTensor]]
1178
+ ]:
1179
+ """
1180
+ Args:
1181
+ hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)`
1182
+ attention_mask (`torch.FloatTensor`, *optional*):
1183
+ attention mask of size `(batch_size, sequence_length)` if flash attention is used or `(batch_size, 1,
1184
+ query_sequence_length, key_sequence_length)` if default attention is used.
1185
+ output_attentions (`bool`, *optional*):
1186
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under
1187
+ returned tensors for more detail.
1188
+ use_cache (`bool`, *optional*):
1189
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding
1190
+ (see `past_key_values`).
1191
+ past_key_value (`Tuple(torch.FloatTensor)`, *optional*): cached past key and value projection states
1192
+ """
1193
+ if "padding_mask" in kwargs:
1194
+ warnings.warn(
1195
+ "Passing `padding_mask` is deprecated and will be removed in v4.37. Please make sure use `attention_mask` instead.`"
1196
+ )
1197
+ residual = hidden_states
1198
+
1199
+ hidden_states = self.input_layernorm(hidden_states)
1200
+
1201
+ # Self Attention
1202
+ hidden_states, self_attn_weights, present_key_value = self.self_attn(
1203
+ hidden_states=hidden_states,
1204
+ attention_mask=attention_mask,
1205
+ position_ids=position_ids,
1206
+ past_key_value=past_key_value,
1207
+ output_attentions=output_attentions,
1208
+ use_cache=use_cache,
1209
+ **kwargs,
1210
+ )
1211
+ hidden_states = residual + hidden_states
1212
+
1213
+ # Fully Connected
1214
+ residual = hidden_states
1215
+ hidden_states = self.post_attention_layernorm(hidden_states)
1216
+ hidden_states = self.mlp(hidden_states)
1217
+ hidden_states = residual + hidden_states
1218
+
1219
+ outputs = (hidden_states,)
1220
+
1221
+ if output_attentions:
1222
+ outputs += (self_attn_weights,)
1223
+
1224
+ if use_cache:
1225
+ outputs += (present_key_value,)
1226
+
1227
+ return outputs
1228
+
1229
+
1230
+ DeepseekV3_START_DOCSTRING = r"""
1231
+ This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
1232
+ library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
1233
+ etc.)
1234
+
1235
+ This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
1236
+ Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
1237
+ and behavior.
1238
+
1239
+ Parameters:
1240
+ config ([`DeepseekV3Config`]):
1241
+ Model configuration class with all the parameters of the model. Initializing with a config file does not
1242
+ load the weights associated with the model, only the configuration. Check out the
1243
+ [`~PreTrainedModel.from_pretrained`] method to load the model weights.
1244
+ """
1245
+
1246
+
1247
+ @add_start_docstrings(
1248
+ "The bare DeepseekV3 Model outputting raw hidden-states without any specific head on top.",
1249
+ DeepseekV3_START_DOCSTRING,
1250
+ )
1251
+ class DeepseekV3PreTrainedModel(PreTrainedModel):
1252
+ config_class = DeepseekV3Config
1253
+ base_model_prefix = "model"
1254
+ supports_gradient_checkpointing = True
1255
+ _no_split_modules = ["DeepseekV3DecoderLayer"]
1256
+ _skip_keys_device_placement = "past_key_values"
1257
+ _supports_flash_attn_2 = True
1258
+ _supports_cache_class = True
1259
+
1260
+ def _init_weights(self, module):
1261
+ std = self.config.initializer_range
1262
+ if isinstance(module, nn.Linear):
1263
+ module.weight.data.normal_(mean=0.0, std=std)
1264
+ if module.bias is not None:
1265
+ module.bias.data.zero_()
1266
+ elif isinstance(module, nn.Embedding):
1267
+ module.weight.data.normal_(mean=0.0, std=std)
1268
+ if module.padding_idx is not None:
1269
+ module.weight.data[module.padding_idx].zero_()
1270
+
1271
+
1272
+ DeepseekV3_INPUTS_DOCSTRING = r"""
1273
+ Args:
1274
+ input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
1275
+ Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
1276
+ it.
1277
+
1278
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
1279
+ [`PreTrainedTokenizer.__call__`] for details.
1280
+
1281
+ [What are input IDs?](../glossary#input-ids)
1282
+ attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
1283
+ Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
1284
+
1285
+ - 1 for tokens that are **not masked**,
1286
+ - 0 for tokens that are **masked**.
1287
+
1288
+ [What are attention masks?](../glossary#attention-mask)
1289
+
1290
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
1291
+ [`PreTrainedTokenizer.__call__`] for details.
1292
+
1293
+ If `past_key_values` is used, optionally only the last `input_ids` have to be input (see
1294
+ `past_key_values`).
1295
+
1296
+ If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_attention_mask`]
1297
+ and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
1298
+ information on the default strategy.
1299
+
1300
+ - 1 indicates the head is **not masked**,
1301
+ - 0 indicates the head is **masked**.
1302
+ position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
1303
+ Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
1304
+ config.n_positions - 1]`.
1305
+
1306
+ [What are position IDs?](../glossary#position-ids)
1307
+ past_key_values (`Cache` or `tuple(tuple(torch.FloatTensor))`, *optional*):
1308
+ Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
1309
+ blocks) that can be used to speed up sequential decoding. This typically consists in the `past_key_values`
1310
+ returned by the model at a previous stage of decoding, when `use_cache=True` or `config.use_cache=True`.
1311
+
1312
+ Two formats are allowed:
1313
+ - a [`~cache_utils.Cache`] instance;
1314
+ - Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of
1315
+ shape `(batch_size, num_heads, sequence_length, embed_size_per_head)`). This is also known as the legacy
1316
+ cache format.
1317
+
1318
+ The model will output the same cache format that is fed as input. If no `past_key_values` are passed, the
1319
+ legacy cache format will be returned.
1320
+
1321
+ If `past_key_values` are used, the user can optionally input only the last `input_ids` (those that don't
1322
+ have their past key value states given to this model) of shape `(batch_size, 1)` instead of all `input_ids`
1323
+ of shape `(batch_size, sequence_length)`.
1324
+ inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
1325
+ Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
1326
+ is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
1327
+ model's internal embedding lookup matrix.
1328
+ use_cache (`bool`, *optional*):
1329
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
1330
+ `past_key_values`).
1331
+ output_attentions (`bool`, *optional*):
1332
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
1333
+ tensors for more detail.
1334
+ output_hidden_states (`bool`, *optional*):
1335
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
1336
+ more detail.
1337
+ return_dict (`bool`, *optional*):
1338
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
1339
+ """
1340
+
1341
+
1342
+ @add_start_docstrings(
1343
+ "The bare DeepseekV3 Model outputting raw hidden-states without any specific head on top.",
1344
+ DeepseekV3_START_DOCSTRING,
1345
+ )
1346
+ class DeepseekV3Model(DeepseekV3PreTrainedModel):
1347
+ """
1348
+ Transformer decoder consisting of *config.num_hidden_layers* layers. Each layer is a [`DeepseekV3DecoderLayer`]
1349
+
1350
+ Args:
1351
+ config: DeepseekV3Config
1352
+ """
1353
+
1354
+ def __init__(self, config: DeepseekV3Config):
1355
+ super().__init__(config)
1356
+ self.padding_idx = config.pad_token_id
1357
+ self.vocab_size = config.vocab_size
1358
+
1359
+ self.embed_tokens = nn.Embedding(
1360
+ config.vocab_size, config.hidden_size, self.padding_idx
1361
+ )
1362
+ self.layers = nn.ModuleList(
1363
+ [
1364
+ DeepseekV3DecoderLayer(config, layer_idx)
1365
+ for layer_idx in range(config.num_hidden_layers)
1366
+ ]
1367
+ )
1368
+ self._use_flash_attention_2 = config._attn_implementation == "flash_attention_2"
1369
+ self.norm = DeepseekV3RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
1370
+
1371
+ self.gradient_checkpointing = False
1372
+ # Initialize weights and apply final processing
1373
+ self.post_init()
1374
+
1375
+ def get_input_embeddings(self):
1376
+ return self.embed_tokens
1377
+
1378
+ def set_input_embeddings(self, value):
1379
+ self.embed_tokens = value
1380
+
1381
+ @add_start_docstrings_to_model_forward(DeepseekV3_INPUTS_DOCSTRING)
1382
+ def forward(
1383
+ self,
1384
+ input_ids: torch.LongTensor = None,
1385
+ attention_mask: Optional[torch.Tensor] = None,
1386
+ position_ids: Optional[torch.LongTensor] = None,
1387
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
1388
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1389
+ use_cache: Optional[bool] = None,
1390
+ output_attentions: Optional[bool] = None,
1391
+ output_hidden_states: Optional[bool] = None,
1392
+ return_dict: Optional[bool] = None,
1393
+ ) -> Union[Tuple, BaseModelOutputWithPast]:
1394
+ output_attentions = (
1395
+ output_attentions
1396
+ if output_attentions is not None
1397
+ else self.config.output_attentions
1398
+ )
1399
+ output_hidden_states = (
1400
+ output_hidden_states
1401
+ if output_hidden_states is not None
1402
+ else self.config.output_hidden_states
1403
+ )
1404
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
1405
+
1406
+ return_dict = (
1407
+ return_dict if return_dict is not None else self.config.use_return_dict
1408
+ )
1409
+
1410
+ # retrieve input_ids and inputs_embeds
1411
+ if input_ids is not None and inputs_embeds is not None:
1412
+ raise ValueError(
1413
+ "You cannot specify both input_ids and inputs_embeds at the same time"
1414
+ )
1415
+ elif input_ids is not None:
1416
+ batch_size, seq_length = input_ids.shape[:2]
1417
+ elif inputs_embeds is not None:
1418
+ batch_size, seq_length = inputs_embeds.shape[:2]
1419
+ else:
1420
+ raise ValueError("You have to specify either input_ids or inputs_embeds")
1421
+
1422
+ past_key_values_length = 0
1423
+ if use_cache:
1424
+ use_legacy_cache = not isinstance(past_key_values, Cache)
1425
+ if use_legacy_cache:
1426
+ past_key_values = DynamicCache.from_legacy_cache(past_key_values)
1427
+ past_key_values_length = past_key_values.get_usable_length(seq_length)
1428
+
1429
+ if position_ids is None:
1430
+ device = input_ids.device if input_ids is not None else inputs_embeds.device
1431
+ position_ids = torch.arange(
1432
+ past_key_values_length,
1433
+ seq_length + past_key_values_length,
1434
+ dtype=torch.long,
1435
+ device=device,
1436
+ )
1437
+ position_ids = position_ids.unsqueeze(0)
1438
+
1439
+ if inputs_embeds is None:
1440
+ inputs_embeds = self.embed_tokens(input_ids)
1441
+
1442
+ if self._use_flash_attention_2:
1443
+ # 2d mask is passed through the layers
1444
+ attention_mask = (
1445
+ attention_mask
1446
+ if (attention_mask is not None and 0 in attention_mask)
1447
+ else None
1448
+ )
1449
+ else:
1450
+ # 4d mask is passed through the layers
1451
+ attention_mask = _prepare_4d_causal_attention_mask(
1452
+ attention_mask,
1453
+ (batch_size, seq_length),
1454
+ inputs_embeds,
1455
+ past_key_values_length,
1456
+ )
1457
+
1458
+ # embed positions
1459
+ hidden_states = inputs_embeds
1460
+
1461
+ # decoder layers
1462
+ all_hidden_states = () if output_hidden_states else None
1463
+ all_self_attns = () if output_attentions else None
1464
+ next_decoder_cache = None
1465
+
1466
+ for decoder_layer in self.layers:
1467
+ if output_hidden_states:
1468
+ all_hidden_states += (hidden_states,)
1469
+
1470
+ layer_outputs = decoder_layer(
1471
+ hidden_states,
1472
+ attention_mask=attention_mask,
1473
+ position_ids=position_ids,
1474
+ past_key_value=past_key_values,
1475
+ output_attentions=output_attentions,
1476
+ use_cache=use_cache,
1477
+ )
1478
+
1479
+ hidden_states = layer_outputs[0]
1480
+
1481
+ if use_cache:
1482
+ next_decoder_cache = layer_outputs[2 if output_attentions else 1]
1483
+
1484
+ if output_attentions:
1485
+ all_self_attns += (layer_outputs[1],)
1486
+
1487
+ hidden_states = self.norm(hidden_states)
1488
+
1489
+ # add hidden states from the last decoder layer
1490
+ if output_hidden_states:
1491
+ all_hidden_states += (hidden_states,)
1492
+
1493
+ next_cache = None
1494
+ if use_cache:
1495
+ next_cache = (
1496
+ next_decoder_cache.to_legacy_cache()
1497
+ if use_legacy_cache
1498
+ else next_decoder_cache
1499
+ )
1500
+ if not return_dict:
1501
+ return tuple(
1502
+ v
1503
+ for v in [hidden_states, next_cache, all_hidden_states, all_self_attns]
1504
+ if v is not None
1505
+ )
1506
+ return BaseModelOutputWithPast(
1507
+ last_hidden_state=hidden_states,
1508
+ past_key_values=next_cache,
1509
+ hidden_states=all_hidden_states,
1510
+ attentions=all_self_attns,
1511
+ )
1512
+
1513
+
1514
+ class DeepseekV3ForCausalLM(DeepseekV3PreTrainedModel):
1515
+ _tied_weights_keys = ["lm_head.weight"]
1516
+
1517
+ def __init__(self, config):
1518
+ super().__init__(config)
1519
+ self.model = DeepseekV3Model(config)
1520
+ self.vocab_size = config.vocab_size
1521
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
1522
+
1523
+ # Initialize weights and apply final processing
1524
+ self.post_init()
1525
+
1526
+ def get_input_embeddings(self):
1527
+ return self.model.embed_tokens
1528
+
1529
+ def set_input_embeddings(self, value):
1530
+ self.model.embed_tokens = value
1531
+
1532
+ def get_output_embeddings(self):
1533
+ return self.lm_head
1534
+
1535
+ def set_output_embeddings(self, new_embeddings):
1536
+ self.lm_head = new_embeddings
1537
+
1538
+ def set_decoder(self, decoder):
1539
+ self.model = decoder
1540
+
1541
+ def get_decoder(self):
1542
+ return self.model
1543
+
1544
+ @add_start_docstrings_to_model_forward(DeepseekV3_INPUTS_DOCSTRING)
1545
+ @replace_return_docstrings(
1546
+ output_type=CausalLMOutputWithPast, config_class=_CONFIG_FOR_DOC
1547
+ )
1548
+ def forward(
1549
+ self,
1550
+ input_ids: torch.LongTensor = None,
1551
+ attention_mask: Optional[torch.Tensor] = None,
1552
+ position_ids: Optional[torch.LongTensor] = None,
1553
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
1554
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1555
+ labels: Optional[torch.LongTensor] = None,
1556
+ use_cache: Optional[bool] = None,
1557
+ output_attentions: Optional[bool] = None,
1558
+ output_hidden_states: Optional[bool] = None,
1559
+ return_dict: Optional[bool] = None,
1560
+ ) -> Union[Tuple, CausalLMOutputWithPast]:
1561
+ r"""
1562
+ Args:
1563
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
1564
+ Labels for computing the masked language modeling loss. Indices should either be in `[0, transformers.,
1565
+ config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
1566
+ (masked), the loss is only computed for the tokens with labels in `[0, transformers., config.vocab_size]`.
1567
+
1568
+ Returns:
1569
+
1570
+ Example:
1571
+
1572
+ ```python
1573
+ >>> from transformers import AutoTokenizer, DeepseekV3ForCausalLM
1574
+
1575
+ >>> model = DeepseekV3ForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
1576
+ >>> tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)
1577
+
1578
+ >>> prompt = "Hey, are you conscious? Can you talk to me?"
1579
+ >>> inputs = tokenizer(prompt, return_tensors="pt")
1580
+
1581
+ >>> # Generate
1582
+ >>> generate_ids = model.generate(inputs.input_ids, max_length=30)
1583
+ >>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
1584
+ "Hey, are you conscious? Can you talk to me?\nI'm not conscious, but I can talk to you."
1585
+ ```"""
1586
+ output_attentions = (
1587
+ output_attentions
1588
+ if output_attentions is not None
1589
+ else self.config.output_attentions
1590
+ )
1591
+ output_hidden_states = (
1592
+ output_hidden_states
1593
+ if output_hidden_states is not None
1594
+ else self.config.output_hidden_states
1595
+ )
1596
+ return_dict = (
1597
+ return_dict if return_dict is not None else self.config.use_return_dict
1598
+ )
1599
+
1600
+ # decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
1601
+ outputs = self.model(
1602
+ input_ids=input_ids,
1603
+ attention_mask=attention_mask,
1604
+ position_ids=position_ids,
1605
+ past_key_values=past_key_values,
1606
+ inputs_embeds=inputs_embeds,
1607
+ use_cache=use_cache,
1608
+ output_attentions=output_attentions,
1609
+ output_hidden_states=output_hidden_states,
1610
+ return_dict=return_dict,
1611
+ )
1612
+
1613
+ hidden_states = outputs[0]
1614
+ logits = self.lm_head(hidden_states)
1615
+ logits = logits.float()
1616
+
1617
+ loss = None
1618
+ if labels is not None:
1619
+ # Shift so that tokens < n predict n
1620
+ shift_logits = logits[..., :-1, :].contiguous()
1621
+ shift_labels = labels[..., 1:].contiguous()
1622
+ # Flatten the tokens
1623
+ loss_fct = CrossEntropyLoss()
1624
+ shift_logits = shift_logits.view(-1, self.config.vocab_size)
1625
+ shift_labels = shift_labels.view(-1)
1626
+ # Enable model parallelism
1627
+ shift_labels = shift_labels.to(shift_logits.device)
1628
+ loss = loss_fct(shift_logits, shift_labels)
1629
+
1630
+ if not return_dict:
1631
+ output = (logits,) + outputs[1:]
1632
+ return (loss,) + output if loss is not None else output
1633
+
1634
+ return CausalLMOutputWithPast(
1635
+ loss=loss,
1636
+ logits=logits,
1637
+ past_key_values=outputs.past_key_values,
1638
+ hidden_states=outputs.hidden_states,
1639
+ attentions=outputs.attentions,
1640
+ )
1641
+
1642
+ def prepare_inputs_for_generation(
1643
+ self,
1644
+ input_ids,
1645
+ past_key_values=None,
1646
+ attention_mask=None,
1647
+ inputs_embeds=None,
1648
+ **kwargs,
1649
+ ):
1650
+ if past_key_values is not None:
1651
+ if isinstance(past_key_values, Cache):
1652
+ cache_length = past_key_values.get_seq_length()
1653
+ past_length = past_key_values.seen_tokens
1654
+ max_cache_length = past_key_values.get_max_length()
1655
+ else:
1656
+ cache_length = past_length = past_key_values[0][0].shape[2]
1657
+ max_cache_length = None
1658
+
1659
+ # Keep only the unprocessed tokens:
1660
+ # 1 - If the length of the attention_mask exceeds the length of input_ids, then we are in a setting where
1661
+ # some of the inputs are exclusivelly passed as part of the cache (e.g. when passing input_embeds as
1662
+ # input)
1663
+ if (
1664
+ attention_mask is not None
1665
+ and attention_mask.shape[1] > input_ids.shape[1]
1666
+ ):
1667
+ input_ids = input_ids[:, -(attention_mask.shape[1] - past_length) :]
1668
+ # 2 - If the past_length is smaller than input_ids', then input_ids holds all input tokens. We can discard
1669
+ # input_ids based on the past_length.
1670
+ elif past_length < input_ids.shape[1]:
1671
+ input_ids = input_ids[:, past_length:]
1672
+ # 3 - Otherwise (past_length >= input_ids.shape[1]), let's assume input_ids only has unprocessed tokens.
1673
+
1674
+ # If we are about to go beyond the maximum cache length, we need to crop the input attention mask.
1675
+ if (
1676
+ max_cache_length is not None
1677
+ and attention_mask is not None
1678
+ and cache_length + input_ids.shape[1] > max_cache_length
1679
+ ):
1680
+ attention_mask = attention_mask[:, -max_cache_length:]
1681
+
1682
+ position_ids = kwargs.get("position_ids", None)
1683
+ if attention_mask is not None and position_ids is None:
1684
+ # create position_ids on the fly for batch generation
1685
+ position_ids = attention_mask.long().cumsum(-1) - 1
1686
+ position_ids.masked_fill_(attention_mask == 0, 1)
1687
+ if past_key_values:
1688
+ position_ids = position_ids[:, -input_ids.shape[1] :]
1689
+
1690
+ # if `inputs_embeds` are passed, we only want to use them in the 1st generation step
1691
+ if inputs_embeds is not None and past_key_values is None:
1692
+ model_inputs = {"inputs_embeds": inputs_embeds}
1693
+ else:
1694
+ model_inputs = {"input_ids": input_ids}
1695
+
1696
+ model_inputs.update(
1697
+ {
1698
+ "position_ids": position_ids,
1699
+ "past_key_values": past_key_values,
1700
+ "use_cache": kwargs.get("use_cache"),
1701
+ "attention_mask": attention_mask,
1702
+ }
1703
+ )
1704
+ return model_inputs
1705
+
1706
+ @staticmethod
1707
+ def _reorder_cache(past_key_values, beam_idx):
1708
+ reordered_past = ()
1709
+ for layer_past in past_key_values:
1710
+ reordered_past += (
1711
+ tuple(
1712
+ past_state.index_select(0, beam_idx.to(past_state.device))
1713
+ for past_state in layer_past
1714
+ ),
1715
+ )
1716
+ return reordered_past
1717
+
1718
+
1719
+ @add_start_docstrings(
1720
+ """
1721
+ The DeepseekV3 Model transformer with a sequence classification head on top (linear layer).
1722
+
1723
+ [`DeepseekV3ForSequenceClassification`] uses the last token in order to do the classification, as other causal models
1724
+ (e.g. GPT-2) do.
1725
+
1726
+ Since it does classification on the last token, it requires to know the position of the last token. If a
1727
+ `pad_token_id` is defined in the configuration, it finds the last token that is not a padding token in each row. If
1728
+ no `pad_token_id` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
1729
+ padding tokens when `inputs_embeds` are passed instead of `input_ids`, it does the same (take the last value in
1730
+ each row of the batch).
1731
+ """,
1732
+ DeepseekV3_START_DOCSTRING,
1733
+ )
1734
+ class DeepseekV3ForSequenceClassification(DeepseekV3PreTrainedModel):
1735
+ def __init__(self, config):
1736
+ super().__init__(config)
1737
+ self.num_labels = config.num_labels
1738
+ self.model = DeepseekV3Model(config)
1739
+ self.score = nn.Linear(config.hidden_size, self.num_labels, bias=False)
1740
+
1741
+ # Initialize weights and apply final processing
1742
+ self.post_init()
1743
+
1744
+ def get_input_embeddings(self):
1745
+ return self.model.embed_tokens
1746
+
1747
+ def set_input_embeddings(self, value):
1748
+ self.model.embed_tokens = value
1749
+
1750
+ @add_start_docstrings_to_model_forward(DeepseekV3_INPUTS_DOCSTRING)
1751
+ def forward(
1752
+ self,
1753
+ input_ids: torch.LongTensor = None,
1754
+ attention_mask: Optional[torch.Tensor] = None,
1755
+ position_ids: Optional[torch.LongTensor] = None,
1756
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
1757
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1758
+ labels: Optional[torch.LongTensor] = None,
1759
+ use_cache: Optional[bool] = None,
1760
+ output_attentions: Optional[bool] = None,
1761
+ output_hidden_states: Optional[bool] = None,
1762
+ return_dict: Optional[bool] = None,
1763
+ ) -> Union[Tuple, SequenceClassifierOutputWithPast]:
1764
+ r"""
1765
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1766
+ Labels for computing the sequence classification/regression loss. Indices should be in `[0, transformers.,
1767
+ config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
1768
+ `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
1769
+ """
1770
+ return_dict = (
1771
+ return_dict if return_dict is not None else self.config.use_return_dict
1772
+ )
1773
+
1774
+ transformer_outputs = self.model(
1775
+ input_ids,
1776
+ attention_mask=attention_mask,
1777
+ position_ids=position_ids,
1778
+ past_key_values=past_key_values,
1779
+ inputs_embeds=inputs_embeds,
1780
+ use_cache=use_cache,
1781
+ output_attentions=output_attentions,
1782
+ output_hidden_states=output_hidden_states,
1783
+ return_dict=return_dict,
1784
+ )
1785
+ hidden_states = transformer_outputs[0]
1786
+ logits = self.score(hidden_states)
1787
+
1788
+ if input_ids is not None:
1789
+ batch_size = input_ids.shape[0]
1790
+ else:
1791
+ batch_size = inputs_embeds.shape[0]
1792
+
1793
+ if self.config.pad_token_id is None and batch_size != 1:
1794
+ raise ValueError(
1795
+ "Cannot handle batch sizes > 1 if no padding token is defined."
1796
+ )
1797
+ if self.config.pad_token_id is None:
1798
+ sequence_lengths = -1
1799
+ else:
1800
+ if input_ids is not None:
1801
+ sequence_lengths = (
1802
+ torch.eq(input_ids, self.config.pad_token_id).int().argmax(-1) - 1
1803
+ ).to(logits.device)
1804
+ else:
1805
+ sequence_lengths = -1
1806
+
1807
+ pooled_logits = logits[
1808
+ torch.arange(batch_size, device=logits.device), sequence_lengths
1809
+ ]
1810
+
1811
+ loss = None
1812
+ if labels is not None:
1813
+ labels = labels.to(logits.device)
1814
+ if self.config.problem_type is None:
1815
+ if self.num_labels == 1:
1816
+ self.config.problem_type = "regression"
1817
+ elif self.num_labels > 1 and (
1818
+ labels.dtype == torch.long or labels.dtype == torch.int
1819
+ ):
1820
+ self.config.problem_type = "single_label_classification"
1821
+ else:
1822
+ self.config.problem_type = "multi_label_classification"
1823
+
1824
+ if self.config.problem_type == "regression":
1825
+ loss_fct = MSELoss()
1826
+ if self.num_labels == 1:
1827
+ loss = loss_fct(pooled_logits.squeeze(), labels.squeeze())
1828
+ else:
1829
+ loss = loss_fct(pooled_logits, labels)
1830
+ elif self.config.problem_type == "single_label_classification":
1831
+ loss_fct = CrossEntropyLoss()
1832
+ loss = loss_fct(
1833
+ pooled_logits.view(-1, self.num_labels), labels.view(-1)
1834
+ )
1835
+ elif self.config.problem_type == "multi_label_classification":
1836
+ loss_fct = BCEWithLogitsLoss()
1837
+ loss = loss_fct(pooled_logits, labels)
1838
+ if not return_dict:
1839
+ output = (pooled_logits,) + transformer_outputs[1:]
1840
+ return ((loss,) + output) if loss is not None else output
1841
+
1842
+ return SequenceClassifierOutputWithPast(
1843
+ loss=loss,
1844
+ logits=pooled_logits,
1845
+ past_key_values=transformer_outputs.past_key_values,
1846
+ hidden_states=transformer_outputs.hidden_states,
1847
+ attentions=transformer_outputs.attentions,
1848
+ )
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|begin▁of▁sentence|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|end▁of▁sentence|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|end▁of▁sentence|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff