snezhanata commited on
Commit
ebdb52e
·
verified ·
1 Parent(s): 515fd85

Upload HunYuanForCausalLM

Browse files
README.md ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ tags:
4
+ - llama-factory
5
+ ---
6
+
7
+ # Model Card for Model ID
8
+
9
+ <!-- Provide a quick summary of what the model is/does. -->
10
+
11
+
12
+
13
+ ## Model Details
14
+
15
+ ### Model Description
16
+
17
+ <!-- Provide a longer summary of what this model is. -->
18
+
19
+ This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
20
+
21
+ - **Developed by:** [More Information Needed]
22
+ - **Funded by [optional]:** [More Information Needed]
23
+ - **Shared by [optional]:** [More Information Needed]
24
+ - **Model type:** [More Information Needed]
25
+ - **Language(s) (NLP):** [More Information Needed]
26
+ - **License:** [More Information Needed]
27
+ - **Finetuned from model [optional]:** [More Information Needed]
28
+
29
+ ### Model Sources [optional]
30
+
31
+ <!-- Provide the basic links for the model. -->
32
+
33
+ - **Repository:** [More Information Needed]
34
+ - **Paper [optional]:** [More Information Needed]
35
+ - **Demo [optional]:** [More Information Needed]
36
+
37
+ ## Uses
38
+
39
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
40
+
41
+ ### Direct Use
42
+
43
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
44
+
45
+ [More Information Needed]
46
+
47
+ ### Downstream Use [optional]
48
+
49
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
50
+
51
+ [More Information Needed]
52
+
53
+ ### Out-of-Scope Use
54
+
55
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
56
+
57
+ [More Information Needed]
58
+
59
+ ## Bias, Risks, and Limitations
60
+
61
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
62
+
63
+ [More Information Needed]
64
+
65
+ ### Recommendations
66
+
67
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
68
+
69
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
70
+
71
+ ## How to Get Started with the Model
72
+
73
+ Use the code below to get started with the model.
74
+
75
+ [More Information Needed]
76
+
77
+ ## Training Details
78
+
79
+ ### Training Data
80
+
81
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
82
+
83
+ [More Information Needed]
84
+
85
+ ### Training Procedure
86
+
87
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
88
+
89
+ #### Preprocessing [optional]
90
+
91
+ [More Information Needed]
92
+
93
+
94
+ #### Training Hyperparameters
95
+
96
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
97
+
98
+ #### Speeds, Sizes, Times [optional]
99
+
100
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
101
+
102
+ [More Information Needed]
103
+
104
+ ## Evaluation
105
+
106
+ <!-- This section describes the evaluation protocols and provides the results. -->
107
+
108
+ ### Testing Data, Factors & Metrics
109
+
110
+ #### Testing Data
111
+
112
+ <!-- This should link to a Dataset Card if possible. -->
113
+
114
+ [More Information Needed]
115
+
116
+ #### Factors
117
+
118
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
119
+
120
+ [More Information Needed]
121
+
122
+ #### Metrics
123
+
124
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
125
+
126
+ [More Information Needed]
127
+
128
+ ### Results
129
+
130
+ [More Information Needed]
131
+
132
+ #### Summary
133
+
134
+
135
+
136
+ ## Model Examination [optional]
137
+
138
+ <!-- Relevant interpretability work for the model goes here -->
139
+
140
+ [More Information Needed]
141
+
142
+ ## Environmental Impact
143
+
144
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
145
+
146
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
147
+
148
+ - **Hardware Type:** [More Information Needed]
149
+ - **Hours used:** [More Information Needed]
150
+ - **Cloud Provider:** [More Information Needed]
151
+ - **Compute Region:** [More Information Needed]
152
+ - **Carbon Emitted:** [More Information Needed]
153
+
154
+ ## Technical Specifications [optional]
155
+
156
+ ### Model Architecture and Objective
157
+
158
+ [More Information Needed]
159
+
160
+ ### Compute Infrastructure
161
+
162
+ [More Information Needed]
163
+
164
+ #### Hardware
165
+
166
+ [More Information Needed]
167
+
168
+ #### Software
169
+
170
+ [More Information Needed]
171
+
172
+ ## Citation [optional]
173
+
174
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
175
+
176
+ **BibTeX:**
177
+
178
+ [More Information Needed]
179
+
180
+ **APA:**
181
+
182
+ [More Information Needed]
183
+
184
+ ## Glossary [optional]
185
+
186
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
187
+
188
+ [More Information Needed]
189
+
190
+ ## More Information [optional]
191
+
192
+ [More Information Needed]
193
+
194
+ ## Model Card Authors [optional]
195
+
196
+ [More Information Needed]
197
+
198
+ ## Model Card Contact
199
+
200
+ [More Information Needed]
config.json ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "HunYuanForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "attention_head_dim": 128,
8
+ "auto_map": {
9
+ "AutoConfig": "configuration_hunyuan.HunYuanConfig",
10
+ "AutoModel": "modeling_hunyuan.HunYuanForCausalLM",
11
+ "AutoModelForCausalLM": "tencent/Hunyuan-7B-Instruct--modeling_hunyuan.HunYuanForCausalLM"
12
+ },
13
+ "bos_token_id": 1,
14
+ "cla_share_factor": 2,
15
+ "eos_token_id": 2,
16
+ "group_limited_greedy": false,
17
+ "hidden_act": "silu",
18
+ "hidden_size": 4096,
19
+ "initializer_range": 0.02,
20
+ "intermediate_size": 14336,
21
+ "kv_lora_rank": null,
22
+ "max_position_embeddings": 4096,
23
+ "mlp_bias": false,
24
+ "model_type": "hunyuan",
25
+ "moe_drop_tokens": false,
26
+ "moe_intermediate_size": [
27
+ 14336,
28
+ 14336,
29
+ 14336,
30
+ 14336,
31
+ 14336,
32
+ 14336,
33
+ 14336,
34
+ 14336,
35
+ 14336,
36
+ 14336,
37
+ 14336,
38
+ 14336,
39
+ 14336,
40
+ 14336,
41
+ 14336,
42
+ 14336,
43
+ 14336,
44
+ 14336,
45
+ 14336,
46
+ 14336,
47
+ 14336,
48
+ 14336,
49
+ 14336,
50
+ 14336,
51
+ 14336,
52
+ 14336,
53
+ 14336,
54
+ 14336,
55
+ 14336,
56
+ 14336,
57
+ 14336,
58
+ 14336
59
+ ],
60
+ "moe_layer_num_skipped": 0,
61
+ "moe_random_routing_dropped_token": false,
62
+ "moe_topk": [
63
+ 1,
64
+ 1,
65
+ 1,
66
+ 1,
67
+ 1,
68
+ 1,
69
+ 1,
70
+ 1,
71
+ 1,
72
+ 1,
73
+ 1,
74
+ 1,
75
+ 1,
76
+ 1,
77
+ 1,
78
+ 1,
79
+ 1,
80
+ 1,
81
+ 1,
82
+ 1,
83
+ 1,
84
+ 1,
85
+ 1,
86
+ 1,
87
+ 1,
88
+ 1,
89
+ 1,
90
+ 1,
91
+ 1,
92
+ 1,
93
+ 1,
94
+ 1
95
+ ],
96
+ "n_group": false,
97
+ "norm_topk_prob": false,
98
+ "num_attention_heads": 32,
99
+ "num_experts": 1,
100
+ "num_hidden_layers": 32,
101
+ "num_key_value_heads": 8,
102
+ "num_shared_expert": [
103
+ 1,
104
+ 1,
105
+ 1,
106
+ 1,
107
+ 1,
108
+ 1,
109
+ 1,
110
+ 1,
111
+ 1,
112
+ 1,
113
+ 1,
114
+ 1,
115
+ 1,
116
+ 1,
117
+ 1,
118
+ 1,
119
+ 1,
120
+ 1,
121
+ 1,
122
+ 1,
123
+ 1,
124
+ 1,
125
+ 1,
126
+ 1,
127
+ 1,
128
+ 1,
129
+ 1,
130
+ 1,
131
+ 1,
132
+ 1,
133
+ 1,
134
+ 1
135
+ ],
136
+ "pad_token_id": 0,
137
+ "pretraining_tp": 1,
138
+ "q_lora_rank": null,
139
+ "qk_nope_head_dim": null,
140
+ "qk_rope_head_dim": null,
141
+ "rms_norm_eps": 1e-05,
142
+ "rope_scaling": {
143
+ "alpha": 1000.0,
144
+ "beta_fast": 32,
145
+ "beta_slow": 1,
146
+ "factor": 1.0,
147
+ "mscale": 1.0,
148
+ "mscale_all_dim": 1.0,
149
+ "type": "dynamic"
150
+ },
151
+ "rope_theta": 10000.0,
152
+ "routed_scaling_factor": false,
153
+ "tie_word_embeddings": true,
154
+ "topk_group": false,
155
+ "torch_dtype": "bfloat16",
156
+ "transformers_version": "4.52.4",
157
+ "use_cache": true,
158
+ "use_cla": false,
159
+ "use_mixed_mlp_moe": false,
160
+ "use_mla": false,
161
+ "use_qk_norm": true,
162
+ "v_head_dim": null,
163
+ "vocab_size": 129024
164
+ }
configuration_hunyuan.py ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved.
3
+ """ HunYuan model configuration"""
4
+
5
+ from transformers.configuration_utils import PretrainedConfig
6
+ from transformers.utils import logging
7
+ from typing import List, Union, Optional
8
+
9
+
10
+ logger = logging.get_logger(__name__)
11
+
12
+
13
+ class HunYuanConfig(PretrainedConfig):
14
+ r"""
15
+ This is the configuration class to store the configuration of a [`HunYuanModel`]. It is used to instantiate an
16
+ HunYuan model according to the specified arguments, defining the model architecture. Instantiating a configuration
17
+ with the defaults will yield a similar configuration to that of the HunYuan-7B.
18
+
19
+ Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
20
+ documentation from [`PretrainedConfig`] for more information.
21
+
22
+
23
+ Args:
24
+ vocab_size (`int`, *optional*, defaults to 32000):
25
+ Vocabulary size of the HunYuan model. Defines the number of different tokens that can be represented by the
26
+ `inputs_ids` passed when calling [`HunYuanModel`]
27
+ hidden_size (`int`, *optional*, defaults to 4096):
28
+ Dimension of the hidden representations.
29
+ intermediate_size (`int`, *optional*, defaults to 11008):
30
+ Dimension of the MLP representations or shared MLP representations.
31
+ moe_intermediate_size (`int` or `List`, *optional*, defaults to 11008):
32
+ Dimension of the MLP representations in MoE. Use a list if you want a different size per layer.
33
+ num_hidden_layers (`int`, *optional*, defaults to 32):
34
+ Number of hidden layers in the Transformer decoder.
35
+ num_attention_heads (`int`, *optional*, defaults to 32):
36
+ Number of attention heads for each attention layer in the Transformer decoder.
37
+ num_key_value_heads (`int`, *optional*):
38
+ This is the number of key_value heads that should be used to implement Grouped Query Attention. If
39
+ `num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
40
+ `num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
41
+ converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
42
+ by meanpooling all the original heads within that group. For more details checkout [this
43
+ paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
44
+ `num_attention_heads`.
45
+ hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
46
+ The non-linear activation function (function or string) in the decoder.
47
+ max_position_embeddings (`int`, *optional*, defaults to 2048):
48
+ The maximum sequence length that this model might ever be used with.
49
+ initializer_range (`float`, *optional*, defaults to 0.02):
50
+ The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
51
+ rms_norm_eps (`float`, *optional*, defaults to 1e-06):
52
+ The epsilon used by the rms normalization layers.
53
+ use_cache (`bool`, *optional*, defaults to `True`):
54
+ Whether or not the model should return the last key/values attentions (not used by all models). Only
55
+ relevant if `config.is_decoder=True`.
56
+ pad_token_id (`int`, *optional*):
57
+ Padding token id.
58
+ bos_token_id (`int`, *optional*, defaults to 1):
59
+ Beginning of stream token id.
60
+ eos_token_id (`int`, *optional*, defaults to 2):
61
+ End of stream token id.
62
+ pretraining_tp (`int`, *optional*, defaults to 1):
63
+ Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
64
+ document](https://huggingface.co/docs/transformers/parallelism) to understand more about it. This value is
65
+ necessary to ensure exact reproducibility of the pretraining results. Please refer to [this
66
+ issue](https://github.com/pytorch/pytorch/issues/76232).
67
+ tie_word_embeddings (`bool`, *optional*, defaults to `False`):
68
+ Whether to tie weight embeddings
69
+ rope_theta (`float`, *optional*, defaults to 10000.0):
70
+ The base period of the RoPE embeddings.
71
+ rope_scaling (`Dict`, *optional*):
72
+ Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
73
+ strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
74
+ `{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
75
+ `max_position_embeddings` to the expected new maximum. See the following thread for more information on how
76
+ these scaling strategies behave:
77
+ https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/. This is an
78
+ experimental feature, subject to breaking API changes in future versions.
79
+ attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
80
+ Whether to use a bias in the query, key, value and output projection layers during self-attention.
81
+ attention_dropout (`float`, *optional*, defaults to 0.0):
82
+ The dropout ratio for the attention probabilities.
83
+ use_qk_norm (`bool`, *optional*, defaults to `False`):
84
+ Whether query and key in attention use norm
85
+ use_cla (`bool`, *optional*, defaults to `False`):
86
+ Whether to use CLA in attention
87
+ cla_share_factor (`int`, *optional*, defaults to 1):
88
+ The share factor of CLA
89
+ num_experts (`int` or `List`, *optional*, defaults to 1):
90
+ The number of experts for moe. If it is a list, it will be used as the number of experts for each layer.
91
+ num_shared_expert (`int` or `List`, *optional*, defaults to 1):
92
+ The number of shared experts for moe. If it is a list, it will be used as the number of shared experts for each layer.
93
+ moe_topk (`int` or `List`, *optional*, defaults to 1):
94
+ The topk value for moe. If it is a list, it will be used as the topk value for each layer.
95
+ capacity_factor (Not used) (`float` or `List`, *optional*, defaults to 1.0):
96
+ The capacity factor for moe. If it is a list, it will be used as the capacity factor for each layer.
97
+ moe_layer_num_skipped (`int`, *optional*, defaults to 0):
98
+ First moe_layer_num_skipped layers do not use MoE.
99
+ """
100
+
101
+ model_type = "hunyuan"
102
+ keys_to_ignore_at_inference = ["past_key_values"]
103
+
104
+ def __init__(
105
+ self,
106
+ vocab_size=290943,
107
+ hidden_size=4096,
108
+ intermediate_size: int=11008,
109
+ moe_intermediate_size: Union[int, List]=None,
110
+ num_hidden_layers=32,
111
+ num_attention_heads=32,
112
+ num_key_value_heads=None,
113
+ attention_head_dim=None,
114
+ hidden_act="silu",
115
+ max_position_embeddings=2048,
116
+ initializer_range=0.02,
117
+ rms_norm_eps=1e-5,
118
+ use_cache=True,
119
+ pad_token_id=0,
120
+ bos_token_id=1,
121
+ eos_token_id=2,
122
+ pretraining_tp=1,
123
+ tie_word_embeddings=False,
124
+ rope_theta=10000.0,
125
+ rope_scaling=None,
126
+ attention_bias=False,
127
+ mlp_bias=False,
128
+ attention_dropout=0.0,
129
+ use_qk_norm=False,
130
+ use_cla=False,
131
+ cla_share_factor=1,
132
+ num_experts: Union[int, List]=1,
133
+ use_mixed_mlp_moe=False,
134
+ num_shared_expert: Union[int, List]=1,
135
+ moe_topk: Union[int, List]=1,
136
+ # capacity_factor: Union[int, List]=1.0,
137
+ moe_drop_tokens=False,
138
+ moe_random_routing_dropped_token=False,
139
+ use_mla=False,
140
+ kv_lora_rank=512,
141
+ q_lora_rank=1536,
142
+ qk_rope_head_dim=64,
143
+ v_head_dim=128,
144
+ qk_nope_head_dim=128,
145
+ moe_layer_num_skipped=0,
146
+ norm_topk_prob=False,
147
+ routed_scaling_factor=1.0,
148
+ group_limited_greedy=False,
149
+ n_group=None,
150
+ topk_group=None,
151
+ **kwargs,
152
+ ):
153
+ self.vocab_size = vocab_size
154
+ self.max_position_embeddings = max_position_embeddings
155
+ self.hidden_size = hidden_size
156
+ self.intermediate_size = intermediate_size
157
+ self.moe_intermediate_size = moe_intermediate_size
158
+ self.num_hidden_layers = num_hidden_layers
159
+ self.num_attention_heads = num_attention_heads
160
+ self.num_experts = num_experts
161
+ self.use_mixed_mlp_moe = use_mixed_mlp_moe
162
+ self.num_shared_expert = num_shared_expert
163
+ self.moe_topk = moe_topk
164
+ # self.capacity_factor = capacity_factor
165
+ self.moe_drop_tokens = moe_drop_tokens
166
+ self.moe_random_routing_dropped_token = moe_random_routing_dropped_token
167
+
168
+ if attention_head_dim is not None:
169
+ self.attention_head_dim = attention_head_dim
170
+ else:
171
+ self.attention_head_dim = self.hidden_size // num_attention_heads
172
+
173
+ # for backward compatibility
174
+ if num_key_value_heads is None:
175
+ num_key_value_heads = num_attention_heads
176
+
177
+ self.num_key_value_heads = num_key_value_heads
178
+ self.hidden_act = hidden_act
179
+ self.initializer_range = initializer_range
180
+ self.rms_norm_eps = rms_norm_eps
181
+ self.pretraining_tp = pretraining_tp
182
+ self.use_cache = use_cache
183
+ self.rope_theta = rope_theta
184
+ self.rope_scaling = rope_scaling
185
+ # self._rope_scaling_validation() # TODO: Need validation?
186
+ self.attention_bias = attention_bias
187
+ self.mlp_bias = mlp_bias
188
+ self.attention_dropout = attention_dropout
189
+ self.use_qk_norm = use_qk_norm
190
+ self.use_cla = use_cla
191
+ self.cla_share_factor = cla_share_factor
192
+
193
+ # MLA args
194
+ self.use_mla = use_mla
195
+ self.kv_lora_rank = kv_lora_rank
196
+ self.q_lora_rank = q_lora_rank
197
+ self.qk_rope_head_dim = qk_rope_head_dim
198
+ self.qk_nope_head_dim = qk_nope_head_dim
199
+ self.v_head_dim = v_head_dim
200
+
201
+ # DeepSeek related args
202
+ self.moe_layer_num_skipped = moe_layer_num_skipped
203
+ self.norm_topk_prob = norm_topk_prob
204
+ self.routed_scaling_factor = routed_scaling_factor
205
+ self.group_limited_greedy = group_limited_greedy
206
+ self.n_group = n_group
207
+ self.topk_group = topk_group
208
+
209
+ super().__init__(
210
+ pad_token_id=pad_token_id,
211
+ bos_token_id=bos_token_id,
212
+ eos_token_id=eos_token_id,
213
+ tie_word_embeddings=tie_word_embeddings,
214
+ **kwargs,
215
+ )
216
+
217
+ def _rope_scaling_validation(self):
218
+ """
219
+ Validate the `rope_scaling` configuration.
220
+ """
221
+ if self.rope_scaling is None:
222
+ return
223
+
224
+ if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:
225
+ raise ValueError(
226
+ "`rope_scaling` must be a dictionary with with two fields, `type` and `factor` or `type` and `alpha`, "
227
+ f"got {self.rope_scaling}"
228
+ )
229
+ rope_scaling_type = self.rope_scaling.get("type", None)
230
+ rope_scaling_factor = self.rope_scaling.get("factor", None)
231
+ rope_scaling_alpha = self.rope_scaling.get("alpha", None)
232
+ if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
233
+ raise ValueError(
234
+ f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}"
235
+ )
236
+ if rope_scaling_factor is None and rope_scaling_alpha is None:
237
+ raise ValueError("`rope_scaling`'s factor or alpha field must be have one, got both of none")
238
+ if rope_scaling_factor is not None:
239
+ if not isinstance(rope_scaling_factor, float) or rope_scaling_factor <= 1.0:
240
+ raise ValueError(f"`rope_scaling`'s factor field must be a float > 1.0, got {rope_scaling_factor}")
241
+ if rope_scaling_alpha is not None:
242
+ if not isinstance(rope_scaling_alpha, float) or rope_scaling_alpha <= 1.0:
243
+ raise ValueError(f"`rope_scaling`'s alpha field must be a float > 1.0, got {rope_scaling_alpha}")
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_sample": true,
3
+ "eos_token_id": [
4
+ 127960,
5
+ 127967
6
+ ],
7
+ "pad_token_id": 127961,
8
+ "repetition_penalty": 1.05,
9
+ "temperature": 0.7,
10
+ "top_k": 20,
11
+ "top_p": 0.6,
12
+ "transformers_version": "4.52.4"
13
+ }
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6d96a3858a922a47f65241b5784725aba38fdb1e77429f3b31064cab424a160
3
+ size 4982993832
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c87f26cdbf64a95dedae485fd3663f745ab7ed9595e8886767f050e49a4e35a
3
+ size 4882367136
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f75b4283c7d62bea8369b008c542841ecf529a0e8f3e0edd959be37640c07d2f
3
+ size 4798480080
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:131769bbb319cc5e3ba8a9d01824dcbef899493fac474ab8cfdbb50cd9a42d46
3
+ size 352346688
model.safetensors.index.json ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 15016157184
4
+ },
5
+ "weight_map": {
6
+ "model.embed_tokens.weight": "model-00001-of-00004.safetensors",
7
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
8
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
9
+ "model.layers.0.mlp.gate_and_up_proj.weight": "model-00001-of-00004.safetensors",
10
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
11
+ "model.layers.0.self_attn.key_layernorm.weight": "model-00001-of-00004.safetensors",
12
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
13
+ "model.layers.0.self_attn.qkv_proj.weight": "model-00001-of-00004.safetensors",
14
+ "model.layers.0.self_attn.query_layernorm.weight": "model-00001-of-00004.safetensors",
15
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
16
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
17
+ "model.layers.1.mlp.gate_and_up_proj.weight": "model-00001-of-00004.safetensors",
18
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
19
+ "model.layers.1.self_attn.key_layernorm.weight": "model-00001-of-00004.safetensors",
20
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
21
+ "model.layers.1.self_attn.qkv_proj.weight": "model-00001-of-00004.safetensors",
22
+ "model.layers.1.self_attn.query_layernorm.weight": "model-00001-of-00004.safetensors",
23
+ "model.layers.10.input_layernorm.weight": "model-00002-of-00004.safetensors",
24
+ "model.layers.10.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
25
+ "model.layers.10.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
26
+ "model.layers.10.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
27
+ "model.layers.10.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
28
+ "model.layers.10.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
29
+ "model.layers.10.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
30
+ "model.layers.10.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
31
+ "model.layers.11.input_layernorm.weight": "model-00002-of-00004.safetensors",
32
+ "model.layers.11.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
33
+ "model.layers.11.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
34
+ "model.layers.11.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
35
+ "model.layers.11.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
36
+ "model.layers.11.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
37
+ "model.layers.11.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
38
+ "model.layers.11.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
39
+ "model.layers.12.input_layernorm.weight": "model-00002-of-00004.safetensors",
40
+ "model.layers.12.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
41
+ "model.layers.12.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
42
+ "model.layers.12.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
43
+ "model.layers.12.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
44
+ "model.layers.12.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
45
+ "model.layers.12.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
46
+ "model.layers.12.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
47
+ "model.layers.13.input_layernorm.weight": "model-00002-of-00004.safetensors",
48
+ "model.layers.13.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
49
+ "model.layers.13.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
50
+ "model.layers.13.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
51
+ "model.layers.13.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
52
+ "model.layers.13.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
53
+ "model.layers.13.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
54
+ "model.layers.13.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
55
+ "model.layers.14.input_layernorm.weight": "model-00002-of-00004.safetensors",
56
+ "model.layers.14.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
57
+ "model.layers.14.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
58
+ "model.layers.14.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
59
+ "model.layers.14.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
60
+ "model.layers.14.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
61
+ "model.layers.14.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
62
+ "model.layers.14.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
63
+ "model.layers.15.input_layernorm.weight": "model-00002-of-00004.safetensors",
64
+ "model.layers.15.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
65
+ "model.layers.15.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
66
+ "model.layers.15.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
67
+ "model.layers.15.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
68
+ "model.layers.15.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
69
+ "model.layers.15.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
70
+ "model.layers.15.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
71
+ "model.layers.16.input_layernorm.weight": "model-00002-of-00004.safetensors",
72
+ "model.layers.16.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
73
+ "model.layers.16.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
74
+ "model.layers.16.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
75
+ "model.layers.16.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
76
+ "model.layers.16.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
77
+ "model.layers.16.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
78
+ "model.layers.16.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
79
+ "model.layers.17.input_layernorm.weight": "model-00002-of-00004.safetensors",
80
+ "model.layers.17.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
81
+ "model.layers.17.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
82
+ "model.layers.17.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
83
+ "model.layers.17.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
84
+ "model.layers.17.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
85
+ "model.layers.17.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
86
+ "model.layers.17.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
87
+ "model.layers.18.input_layernorm.weight": "model-00002-of-00004.safetensors",
88
+ "model.layers.18.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
89
+ "model.layers.18.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
90
+ "model.layers.18.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
91
+ "model.layers.18.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
92
+ "model.layers.18.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
93
+ "model.layers.18.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
94
+ "model.layers.18.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
95
+ "model.layers.19.input_layernorm.weight": "model-00002-of-00004.safetensors",
96
+ "model.layers.19.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
97
+ "model.layers.19.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
98
+ "model.layers.19.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
99
+ "model.layers.19.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
100
+ "model.layers.19.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
101
+ "model.layers.19.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
102
+ "model.layers.19.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
103
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
104
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
105
+ "model.layers.2.mlp.gate_and_up_proj.weight": "model-00001-of-00004.safetensors",
106
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
107
+ "model.layers.2.self_attn.key_layernorm.weight": "model-00001-of-00004.safetensors",
108
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
109
+ "model.layers.2.self_attn.qkv_proj.weight": "model-00001-of-00004.safetensors",
110
+ "model.layers.2.self_attn.query_layernorm.weight": "model-00001-of-00004.safetensors",
111
+ "model.layers.20.input_layernorm.weight": "model-00003-of-00004.safetensors",
112
+ "model.layers.20.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
113
+ "model.layers.20.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
114
+ "model.layers.20.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
115
+ "model.layers.20.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
116
+ "model.layers.20.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
117
+ "model.layers.20.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
118
+ "model.layers.20.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
119
+ "model.layers.21.input_layernorm.weight": "model-00003-of-00004.safetensors",
120
+ "model.layers.21.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
121
+ "model.layers.21.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
122
+ "model.layers.21.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
123
+ "model.layers.21.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
124
+ "model.layers.21.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
125
+ "model.layers.21.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
126
+ "model.layers.21.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
127
+ "model.layers.22.input_layernorm.weight": "model-00003-of-00004.safetensors",
128
+ "model.layers.22.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
129
+ "model.layers.22.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
130
+ "model.layers.22.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
131
+ "model.layers.22.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
132
+ "model.layers.22.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
133
+ "model.layers.22.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
134
+ "model.layers.22.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
135
+ "model.layers.23.input_layernorm.weight": "model-00003-of-00004.safetensors",
136
+ "model.layers.23.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
137
+ "model.layers.23.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
138
+ "model.layers.23.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
139
+ "model.layers.23.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
140
+ "model.layers.23.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
141
+ "model.layers.23.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
142
+ "model.layers.23.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
143
+ "model.layers.24.input_layernorm.weight": "model-00003-of-00004.safetensors",
144
+ "model.layers.24.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
145
+ "model.layers.24.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
146
+ "model.layers.24.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
147
+ "model.layers.24.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
148
+ "model.layers.24.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
149
+ "model.layers.24.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
150
+ "model.layers.24.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
151
+ "model.layers.25.input_layernorm.weight": "model-00003-of-00004.safetensors",
152
+ "model.layers.25.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
153
+ "model.layers.25.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
154
+ "model.layers.25.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
155
+ "model.layers.25.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
156
+ "model.layers.25.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
157
+ "model.layers.25.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
158
+ "model.layers.25.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
159
+ "model.layers.26.input_layernorm.weight": "model-00003-of-00004.safetensors",
160
+ "model.layers.26.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
161
+ "model.layers.26.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
162
+ "model.layers.26.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
163
+ "model.layers.26.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
164
+ "model.layers.26.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
165
+ "model.layers.26.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
166
+ "model.layers.26.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
167
+ "model.layers.27.input_layernorm.weight": "model-00003-of-00004.safetensors",
168
+ "model.layers.27.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
169
+ "model.layers.27.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
170
+ "model.layers.27.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
171
+ "model.layers.27.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
172
+ "model.layers.27.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
173
+ "model.layers.27.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
174
+ "model.layers.27.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
175
+ "model.layers.28.input_layernorm.weight": "model-00003-of-00004.safetensors",
176
+ "model.layers.28.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
177
+ "model.layers.28.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
178
+ "model.layers.28.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
179
+ "model.layers.28.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
180
+ "model.layers.28.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
181
+ "model.layers.28.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
182
+ "model.layers.28.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
183
+ "model.layers.29.input_layernorm.weight": "model-00003-of-00004.safetensors",
184
+ "model.layers.29.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
185
+ "model.layers.29.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
186
+ "model.layers.29.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
187
+ "model.layers.29.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
188
+ "model.layers.29.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
189
+ "model.layers.29.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
190
+ "model.layers.29.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
191
+ "model.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
192
+ "model.layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
193
+ "model.layers.3.mlp.gate_and_up_proj.weight": "model-00001-of-00004.safetensors",
194
+ "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
195
+ "model.layers.3.self_attn.key_layernorm.weight": "model-00001-of-00004.safetensors",
196
+ "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
197
+ "model.layers.3.self_attn.qkv_proj.weight": "model-00001-of-00004.safetensors",
198
+ "model.layers.3.self_attn.query_layernorm.weight": "model-00001-of-00004.safetensors",
199
+ "model.layers.30.input_layernorm.weight": "model-00003-of-00004.safetensors",
200
+ "model.layers.30.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
201
+ "model.layers.30.mlp.gate_and_up_proj.weight": "model-00003-of-00004.safetensors",
202
+ "model.layers.30.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
203
+ "model.layers.30.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
204
+ "model.layers.30.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
205
+ "model.layers.30.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
206
+ "model.layers.30.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
207
+ "model.layers.31.input_layernorm.weight": "model-00004-of-00004.safetensors",
208
+ "model.layers.31.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
209
+ "model.layers.31.mlp.gate_and_up_proj.weight": "model-00004-of-00004.safetensors",
210
+ "model.layers.31.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
211
+ "model.layers.31.self_attn.key_layernorm.weight": "model-00003-of-00004.safetensors",
212
+ "model.layers.31.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
213
+ "model.layers.31.self_attn.qkv_proj.weight": "model-00003-of-00004.safetensors",
214
+ "model.layers.31.self_attn.query_layernorm.weight": "model-00003-of-00004.safetensors",
215
+ "model.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
216
+ "model.layers.4.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
217
+ "model.layers.4.mlp.gate_and_up_proj.weight": "model-00001-of-00004.safetensors",
218
+ "model.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
219
+ "model.layers.4.self_attn.key_layernorm.weight": "model-00001-of-00004.safetensors",
220
+ "model.layers.4.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
221
+ "model.layers.4.self_attn.qkv_proj.weight": "model-00001-of-00004.safetensors",
222
+ "model.layers.4.self_attn.query_layernorm.weight": "model-00001-of-00004.safetensors",
223
+ "model.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
224
+ "model.layers.5.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
225
+ "model.layers.5.mlp.gate_and_up_proj.weight": "model-00001-of-00004.safetensors",
226
+ "model.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
227
+ "model.layers.5.self_attn.key_layernorm.weight": "model-00001-of-00004.safetensors",
228
+ "model.layers.5.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
229
+ "model.layers.5.self_attn.qkv_proj.weight": "model-00001-of-00004.safetensors",
230
+ "model.layers.5.self_attn.query_layernorm.weight": "model-00001-of-00004.safetensors",
231
+ "model.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
232
+ "model.layers.6.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
233
+ "model.layers.6.mlp.gate_and_up_proj.weight": "model-00001-of-00004.safetensors",
234
+ "model.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
235
+ "model.layers.6.self_attn.key_layernorm.weight": "model-00001-of-00004.safetensors",
236
+ "model.layers.6.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
237
+ "model.layers.6.self_attn.qkv_proj.weight": "model-00001-of-00004.safetensors",
238
+ "model.layers.6.self_attn.query_layernorm.weight": "model-00001-of-00004.safetensors",
239
+ "model.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
240
+ "model.layers.7.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
241
+ "model.layers.7.mlp.gate_and_up_proj.weight": "model-00001-of-00004.safetensors",
242
+ "model.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
243
+ "model.layers.7.self_attn.key_layernorm.weight": "model-00001-of-00004.safetensors",
244
+ "model.layers.7.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
245
+ "model.layers.7.self_attn.qkv_proj.weight": "model-00001-of-00004.safetensors",
246
+ "model.layers.7.self_attn.query_layernorm.weight": "model-00001-of-00004.safetensors",
247
+ "model.layers.8.input_layernorm.weight": "model-00001-of-00004.safetensors",
248
+ "model.layers.8.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
249
+ "model.layers.8.mlp.gate_and_up_proj.weight": "model-00001-of-00004.safetensors",
250
+ "model.layers.8.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
251
+ "model.layers.8.self_attn.key_layernorm.weight": "model-00001-of-00004.safetensors",
252
+ "model.layers.8.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
253
+ "model.layers.8.self_attn.qkv_proj.weight": "model-00001-of-00004.safetensors",
254
+ "model.layers.8.self_attn.query_layernorm.weight": "model-00001-of-00004.safetensors",
255
+ "model.layers.9.input_layernorm.weight": "model-00002-of-00004.safetensors",
256
+ "model.layers.9.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
257
+ "model.layers.9.mlp.gate_and_up_proj.weight": "model-00002-of-00004.safetensors",
258
+ "model.layers.9.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
259
+ "model.layers.9.self_attn.key_layernorm.weight": "model-00002-of-00004.safetensors",
260
+ "model.layers.9.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
261
+ "model.layers.9.self_attn.qkv_proj.weight": "model-00002-of-00004.safetensors",
262
+ "model.layers.9.self_attn.query_layernorm.weight": "model-00002-of-00004.safetensors",
263
+ "model.norm.weight": "model-00004-of-00004.safetensors"
264
+ }
265
+ }
modeling_hunyuan.py ADDED
The diff for this file is too large to render. See raw diff