jobs-git woodchen7 commited on
Commit
98e3b4c
·
verified ·
0 Parent(s):

Duplicate from tencent/Tencent-Hunyuan-Large

Browse files

Co-authored-by: woodchen <[email protected]>

This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +35 -0
  2. Hunyuan-A52B-Instruct-FP8/config.json +118 -0
  3. Hunyuan-A52B-Instruct-FP8/configuration_hunyuan.py +206 -0
  4. Hunyuan-A52B-Instruct-FP8/generation_config.json +13 -0
  5. Hunyuan-A52B-Instruct-FP8/hy.tiktoken +0 -0
  6. Hunyuan-A52B-Instruct-FP8/model-00001-of-00080.safetensors +3 -0
  7. Hunyuan-A52B-Instruct-FP8/model-00002-of-00080.safetensors +3 -0
  8. Hunyuan-A52B-Instruct-FP8/model-00003-of-00080.safetensors +3 -0
  9. Hunyuan-A52B-Instruct-FP8/model-00004-of-00080.safetensors +3 -0
  10. Hunyuan-A52B-Instruct-FP8/model-00005-of-00080.safetensors +3 -0
  11. Hunyuan-A52B-Instruct-FP8/model-00006-of-00080.safetensors +3 -0
  12. Hunyuan-A52B-Instruct-FP8/model-00007-of-00080.safetensors +3 -0
  13. Hunyuan-A52B-Instruct-FP8/model-00008-of-00080.safetensors +3 -0
  14. Hunyuan-A52B-Instruct-FP8/model-00009-of-00080.safetensors +3 -0
  15. Hunyuan-A52B-Instruct-FP8/model-00010-of-00080.safetensors +3 -0
  16. Hunyuan-A52B-Instruct-FP8/model-00011-of-00080.safetensors +3 -0
  17. Hunyuan-A52B-Instruct-FP8/model-00012-of-00080.safetensors +3 -0
  18. Hunyuan-A52B-Instruct-FP8/model-00013-of-00080.safetensors +3 -0
  19. Hunyuan-A52B-Instruct-FP8/model-00014-of-00080.safetensors +3 -0
  20. Hunyuan-A52B-Instruct-FP8/model-00015-of-00080.safetensors +3 -0
  21. Hunyuan-A52B-Instruct-FP8/model-00016-of-00080.safetensors +3 -0
  22. Hunyuan-A52B-Instruct-FP8/model-00017-of-00080.safetensors +3 -0
  23. Hunyuan-A52B-Instruct-FP8/model-00018-of-00080.safetensors +3 -0
  24. Hunyuan-A52B-Instruct-FP8/model-00019-of-00080.safetensors +3 -0
  25. Hunyuan-A52B-Instruct-FP8/model-00020-of-00080.safetensors +3 -0
  26. Hunyuan-A52B-Instruct-FP8/model-00021-of-00080.safetensors +3 -0
  27. Hunyuan-A52B-Instruct-FP8/model-00022-of-00080.safetensors +3 -0
  28. Hunyuan-A52B-Instruct-FP8/model-00023-of-00080.safetensors +3 -0
  29. Hunyuan-A52B-Instruct-FP8/model-00024-of-00080.safetensors +3 -0
  30. Hunyuan-A52B-Instruct-FP8/model-00025-of-00080.safetensors +3 -0
  31. Hunyuan-A52B-Instruct-FP8/model-00026-of-00080.safetensors +3 -0
  32. Hunyuan-A52B-Instruct-FP8/model-00027-of-00080.safetensors +3 -0
  33. Hunyuan-A52B-Instruct-FP8/model-00028-of-00080.safetensors +3 -0
  34. Hunyuan-A52B-Instruct-FP8/model-00029-of-00080.safetensors +3 -0
  35. Hunyuan-A52B-Instruct-FP8/model-00030-of-00080.safetensors +3 -0
  36. Hunyuan-A52B-Instruct-FP8/model-00031-of-00080.safetensors +3 -0
  37. Hunyuan-A52B-Instruct-FP8/model-00032-of-00080.safetensors +3 -0
  38. Hunyuan-A52B-Instruct-FP8/model-00033-of-00080.safetensors +3 -0
  39. Hunyuan-A52B-Instruct-FP8/model-00034-of-00080.safetensors +3 -0
  40. Hunyuan-A52B-Instruct-FP8/model-00035-of-00080.safetensors +3 -0
  41. Hunyuan-A52B-Instruct-FP8/model-00036-of-00080.safetensors +3 -0
  42. Hunyuan-A52B-Instruct-FP8/model-00037-of-00080.safetensors +3 -0
  43. Hunyuan-A52B-Instruct-FP8/model-00038-of-00080.safetensors +3 -0
  44. Hunyuan-A52B-Instruct-FP8/model-00039-of-00080.safetensors +3 -0
  45. Hunyuan-A52B-Instruct-FP8/model-00040-of-00080.safetensors +3 -0
  46. Hunyuan-A52B-Instruct-FP8/model-00041-of-00080.safetensors +3 -0
  47. Hunyuan-A52B-Instruct-FP8/model-00042-of-00080.safetensors +3 -0
  48. Hunyuan-A52B-Instruct-FP8/model-00043-of-00080.safetensors +3 -0
  49. Hunyuan-A52B-Instruct-FP8/model-00044-of-00080.safetensors +3 -0
  50. Hunyuan-A52B-Instruct-FP8/model-00045-of-00080.safetensors +3 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
Hunyuan-A52B-Instruct-FP8/config.json ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "HunYuanForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_hunyuan.HunYuanConfig",
9
+ "AutoModel": "modeling_hunyuan.HunyuanModel",
10
+ "AutoModelForCausalLM": "modeling_hunyuan.HunYuanForCausalLM"
11
+ },
12
+ "bos_token_id": 1,
13
+ "capacity_factor": 1.0,
14
+ "cla_share_factor": 2,
15
+ "eos_token_id": 2,
16
+ "hidden_act": "silu",
17
+ "hidden_size": 6400,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 18304,
20
+ "max_position_embeddings": 131072,
21
+ "model_type": "hunyuan",
22
+ "moe_drop_tokens": false,
23
+ "moe_random_routing_dropped_token": false,
24
+ "moe_topk": 1,
25
+ "num_attention_heads": 80,
26
+ "num_experts": 16,
27
+ "num_hidden_layers": 64,
28
+ "num_key_value_heads": 8,
29
+ "num_shared_expert": 1,
30
+ "pad_token_id": 0,
31
+ "pretraining_tp": 1,
32
+ "quantization_config": {
33
+ "activation_scheme": "static",
34
+ "ignored_layers": [
35
+ "model.layers.38.mlp.gate.wg",
36
+ "model.layers.60.mlp.gate.wg",
37
+ "model.layers.20.mlp.gate.wg",
38
+ "model.layers.11.mlp.gate.wg",
39
+ "model.layers.37.mlp.gate.wg",
40
+ "model.layers.51.mlp.gate.wg",
41
+ "model.layers.54.mlp.gate.wg",
42
+ "model.layers.49.mlp.gate.wg",
43
+ "model.layers.59.mlp.gate.wg",
44
+ "lm_head",
45
+ "model.layers.61.mlp.gate.wg",
46
+ "model.layers.50.mlp.gate.wg",
47
+ "model.layers.26.mlp.gate.wg",
48
+ "model.layers.34.mlp.gate.wg",
49
+ "model.layers.29.mlp.gate.wg",
50
+ "model.layers.2.mlp.gate.wg",
51
+ "model.layers.58.mlp.gate.wg",
52
+ "model.layers.23.mlp.gate.wg",
53
+ "model.layers.16.mlp.gate.wg",
54
+ "model.layers.4.mlp.gate.wg",
55
+ "model.layers.31.mlp.gate.wg",
56
+ "model.layers.45.mlp.gate.wg",
57
+ "model.layers.56.mlp.gate.wg",
58
+ "model.layers.3.mlp.gate.wg",
59
+ "model.layers.19.mlp.gate.wg",
60
+ "model.layers.14.mlp.gate.wg",
61
+ "model.layers.8.mlp.gate.wg",
62
+ "model.layers.41.mlp.gate.wg",
63
+ "model.layers.53.mlp.gate.wg",
64
+ "model.layers.46.mlp.gate.wg",
65
+ "model.layers.7.mlp.gate.wg",
66
+ "model.layers.25.mlp.gate.wg",
67
+ "model.layers.6.mlp.gate.wg",
68
+ "model.layers.1.mlp.gate.wg",
69
+ "model.layers.10.mlp.gate.wg",
70
+ "model.layers.12.mlp.gate.wg",
71
+ "model.layers.15.mlp.gate.wg",
72
+ "model.layers.18.mlp.gate.wg",
73
+ "model.layers.57.mlp.gate.wg",
74
+ "model.layers.63.mlp.gate.wg",
75
+ "model.layers.55.mlp.gate.wg",
76
+ "model.layers.40.mlp.gate.wg",
77
+ "model.layers.32.mlp.gate.wg",
78
+ "model.layers.39.mlp.gate.wg",
79
+ "model.layers.62.mlp.gate.wg",
80
+ "model.layers.28.mlp.gate.wg",
81
+ "model.layers.30.mlp.gate.wg",
82
+ "model.layers.27.mlp.gate.wg",
83
+ "model.layers.22.mlp.gate.wg",
84
+ "model.layers.5.mlp.gate.wg",
85
+ "model.layers.21.mlp.gate.wg",
86
+ "model.layers.36.mlp.gate.wg",
87
+ "model.layers.48.mlp.gate.wg",
88
+ "model.layers.42.mlp.gate.wg",
89
+ "model.layers.44.mlp.gate.wg",
90
+ "model.layers.52.mlp.gate.wg",
91
+ "model.layers.0.mlp.gate.wg",
92
+ "model.layers.13.mlp.gate.wg",
93
+ "model.layers.17.mlp.gate.wg",
94
+ "model.layers.24.mlp.gate.wg",
95
+ "model.layers.33.mlp.gate.wg",
96
+ "model.layers.35.mlp.gate.wg",
97
+ "model.layers.43.mlp.gate.wg",
98
+ "model.layers.47.mlp.gate.wg",
99
+ "model.layers.9.mlp.gate.wg"
100
+ ],
101
+ "quant_method": "fp8"
102
+ },
103
+ "rms_norm_eps": 1e-05,
104
+ "rope_scaling": {
105
+ "alpha": 1000.0,
106
+ "factor": 1.0,
107
+ "type": "dynamic"
108
+ },
109
+ "rope_theta": 10000.0,
110
+ "tie_word_embeddings": true,
111
+ "torch_dtype": "bfloat16",
112
+ "transformers_version": "4.44.2",
113
+ "use_cache": true,
114
+ "use_cla": true,
115
+ "use_mixed_mlp_moe": true,
116
+ "use_qk_norm": true,
117
+ "vocab_size": 129024
118
+ }
Hunyuan-A52B-Instruct-FP8/configuration_hunyuan.py ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2024 THL A29 Limited, a Tencent company. All rights reserved.
2
+ #
3
+ # Licensed under the TENCENT HUNYUAN COMMUNITY LICENSE AGREEMENT (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://github.com/Tencent/Tencent-Hunyuan-Large/blob/main/License.docx
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """ HunYuan model configuration"""
15
+
16
+ from transformers.configuration_utils import PretrainedConfig
17
+ from transformers.utils import logging
18
+
19
+
20
+ logger = logging.get_logger(__name__)
21
+
22
+
23
+ class HunYuanConfig(PretrainedConfig):
24
+ r"""
25
+ This is the configuration class to store the configuration of a [`HunYuanModel`]. It is used to instantiate an
26
+ HunYuan model according to the specified arguments, defining the model architecture. Instantiating a configuration
27
+ with the defaults will yield a similar configuration to that of the HunYuan-7B.
28
+
29
+ Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
30
+ documentation from [`PretrainedConfig`] for more information.
31
+
32
+
33
+ Args:
34
+ vocab_size (`int`, *optional*, defaults to 32000):
35
+ Vocabulary size of the HunYuan model. Defines the number of different tokens that can be represented by the
36
+ `inputs_ids` passed when calling [`HunYuanModel`]
37
+ hidden_size (`int`, *optional*, defaults to 4096):
38
+ Dimension of the hidden representations.
39
+ intermediate_size (`int`, *optional*, defaults to 11008):
40
+ Dimension of the MLP representations.
41
+ num_hidden_layers (`int`, *optional*, defaults to 32):
42
+ Number of hidden layers in the Transformer decoder.
43
+ num_attention_heads (`int`, *optional*, defaults to 32):
44
+ Number of attention heads for each attention layer in the Transformer decoder.
45
+ num_key_value_heads (`int`, *optional*):
46
+ This is the number of key_value heads that should be used to implement Grouped Query Attention. If
47
+ `num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
48
+ `num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
49
+ converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
50
+ by meanpooling all the original heads within that group. For more details checkout [this
51
+ paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
52
+ `num_attention_heads`.
53
+ hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
54
+ The non-linear activation function (function or string) in the decoder.
55
+ max_position_embeddings (`int`, *optional*, defaults to 2048):
56
+ The maximum sequence length that this model might ever be used with.
57
+ initializer_range (`float`, *optional*, defaults to 0.02):
58
+ The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
59
+ rms_norm_eps (`float`, *optional*, defaults to 1e-06):
60
+ The epsilon used by the rms normalization layers.
61
+ use_cache (`bool`, *optional*, defaults to `True`):
62
+ Whether or not the model should return the last key/values attentions (not used by all models). Only
63
+ relevant if `config.is_decoder=True`.
64
+ pad_token_id (`int`, *optional*):
65
+ Padding token id.
66
+ bos_token_id (`int`, *optional*, defaults to 1):
67
+ Beginning of stream token id.
68
+ eos_token_id (`int`, *optional*, defaults to 2):
69
+ End of stream token id.
70
+ pretraining_tp (`int`, *optional*, defaults to 1):
71
+ Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
72
+ document](https://huggingface.co/docs/transformers/parallelism) to understand more about it. This value is
73
+ necessary to ensure exact reproducibility of the pretraining results. Please refer to [this
74
+ issue](https://github.com/pytorch/pytorch/issues/76232).
75
+ tie_word_embeddings (`bool`, *optional*, defaults to `False`):
76
+ Whether to tie weight embeddings
77
+ rope_theta (`float`, *optional*, defaults to 10000.0):
78
+ The base period of the RoPE embeddings.
79
+ rope_scaling (`Dict`, *optional*):
80
+ Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
81
+ strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
82
+ `{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
83
+ `max_position_embeddings` to the expected new maximum. See the following thread for more information on how
84
+ these scaling strategies behave:
85
+ https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/. This is an
86
+ experimental feature, subject to breaking API changes in future versions.
87
+ attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
88
+ Whether to use a bias in the query, key, value and output projection layers during self-attention.
89
+ attention_dropout (`float`, *optional*, defaults to 0.0):
90
+ The dropout ratio for the attention probabilities.
91
+ use_qk_norm (`bool`, *optional*, defaults to `False`):
92
+ Whether query and key in attention use norm
93
+ use_cla (`bool`, *optional*, defaults to `False`):
94
+ Whether to use CLA in attention
95
+ cla_share_factor (`int`, *optional*, defaults to 1):
96
+ The share factor of CLA
97
+ """
98
+
99
+ model_type = "hunyuan"
100
+ keys_to_ignore_at_inference = ["past_key_values"]
101
+
102
+ def __init__(
103
+ self,
104
+ vocab_size=290943,
105
+ hidden_size=4096,
106
+ intermediate_size=11008,
107
+ num_hidden_layers=32,
108
+ num_attention_heads=32,
109
+ num_key_value_heads=None,
110
+ hidden_act="silu",
111
+ max_position_embeddings=2048,
112
+ initializer_range=0.02,
113
+ rms_norm_eps=1e-5,
114
+ use_cache=True,
115
+ pad_token_id=0,
116
+ bos_token_id=1,
117
+ eos_token_id=2,
118
+ pretraining_tp=1,
119
+ tie_word_embeddings=False,
120
+ rope_theta=10000.0,
121
+ rope_scaling=None,
122
+ attention_bias=False,
123
+ attention_dropout=0.0,
124
+ use_qk_norm=False,
125
+ use_cla=False,
126
+ cla_share_factor=1,
127
+ num_experts=1,
128
+ use_mixed_mlp_moe=False,
129
+ num_shared_expert=1,
130
+ moe_topk=1,
131
+ capacity_factor=1.0,
132
+ moe_drop_tokens=False,
133
+ moe_random_routing_dropped_token=False,
134
+ **kwargs,
135
+ ):
136
+ self.vocab_size = vocab_size
137
+ self.max_position_embeddings = max_position_embeddings
138
+ self.hidden_size = hidden_size
139
+ self.intermediate_size = intermediate_size
140
+ self.num_hidden_layers = num_hidden_layers
141
+ self.num_attention_heads = num_attention_heads
142
+ self.num_experts = num_experts
143
+ self.use_mixed_mlp_moe = use_mixed_mlp_moe
144
+ self.num_shared_expert = num_shared_expert
145
+ self.moe_topk = moe_topk
146
+ self.capacity_factor = capacity_factor
147
+ self.moe_drop_tokens = moe_drop_tokens
148
+ self.moe_random_routing_dropped_token = moe_random_routing_dropped_token
149
+
150
+ # for backward compatibility
151
+ if num_key_value_heads is None:
152
+ num_key_value_heads = num_attention_heads
153
+
154
+ self.num_key_value_heads = num_key_value_heads
155
+ self.hidden_act = hidden_act
156
+ self.initializer_range = initializer_range
157
+ self.rms_norm_eps = rms_norm_eps
158
+ self.pretraining_tp = pretraining_tp
159
+ self.use_cache = use_cache
160
+ self.rope_theta = rope_theta
161
+ self.rope_scaling = rope_scaling
162
+ # self._rope_scaling_validation() # TODO: Need validation?
163
+ self.attention_bias = attention_bias
164
+ self.attention_dropout = attention_dropout
165
+ self.use_qk_norm = use_qk_norm
166
+ self.use_cla = use_cla
167
+ self.cla_share_factor = cla_share_factor
168
+
169
+ super().__init__(
170
+ pad_token_id=pad_token_id,
171
+ bos_token_id=bos_token_id,
172
+ eos_token_id=eos_token_id,
173
+ tie_word_embeddings=tie_word_embeddings,
174
+ **kwargs,
175
+ )
176
+
177
+ def _rope_scaling_validation(self):
178
+ """
179
+ Validate the `rope_scaling` configuration.
180
+ """
181
+ if self.rope_scaling is None:
182
+ return
183
+
184
+ if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:
185
+ raise ValueError(
186
+ "`rope_scaling` must be a dictionary with with two fields, `type` and `factor` or `type` and `alpha`, "
187
+ f"got {self.rope_scaling}"
188
+ )
189
+ rope_scaling_type = self.rope_scaling.get("type", None)
190
+ rope_scaling_factor = self.rope_scaling.get("factor", None)
191
+ rope_scaling_alpha = self.rope_scaling.get("alpha", None)
192
+ if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
193
+ raise ValueError(
194
+ f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}"
195
+ )
196
+ if rope_scaling_factor is None and rope_scaling_alpha is None:
197
+ raise ValueError(f"`rope_scaling`'s factor or alpha field must be have one, got both of none")
198
+ if rope_scaling_factor is not None:
199
+ if not isinstance(rope_scaling_factor, float) or rope_scaling_factor <= 1.0:
200
+ raise ValueError(f"`rope_scaling`'s factor field must be a float > 1.0, got {rope_scaling_factor}")
201
+ if rope_scaling_alpha is not None:
202
+ if not isinstance(rope_scaling_alpha, float) or rope_scaling_alpha <= 1.0:
203
+ raise ValueError(f"`rope_scaling`'s alpha field must be a float > 1.0, got {rope_scaling_alpha}")
204
+
205
+
206
+
Hunyuan-A52B-Instruct-FP8/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.44.2"
13
+ }
Hunyuan-A52B-Instruct-FP8/hy.tiktoken ADDED
The diff for this file is too large to render. See raw diff
 
Hunyuan-A52B-Instruct-FP8/model-00001-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:521c6c7aabefd888aeb2937ed6eecb1d9d7dd30b866e0e6eb7beeed2dbaef264
3
+ size 4904971448
Hunyuan-A52B-Instruct-FP8/model-00002-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c45b39e3fd58782d342c076a607eb493799bc22a503766ef645588f822aa51dc
3
+ size 4885340536
Hunyuan-A52B-Instruct-FP8/model-00003-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5050ea793ed99055b7ab92c6ea3a0c47e123d14f858db034f84a8a66b9cd3b1e
3
+ size 4893533216
Hunyuan-A52B-Instruct-FP8/model-00004-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0119bcf5d96466178f6ed5cb08af964b8acfe8268cc7f4a86584b376674f1a27
3
+ size 4920129704
Hunyuan-A52B-Instruct-FP8/model-00005-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9dc50b08030c0bcb750505d63ee7fc74003d07c297f95d8a4bad047b8148809
3
+ size 4885340512
Hunyuan-A52B-Instruct-FP8/model-00006-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73be942dcde5dab69298870ee0f3c32f44d057f82315ebf1f8a1f22a02fb75a2
3
+ size 4893533192
Hunyuan-A52B-Instruct-FP8/model-00007-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08532bee0ab217deca4c72e97e2f69cb2e030db30949619f4d1836db602cac1e
3
+ size 4885340544
Hunyuan-A52B-Instruct-FP8/model-00008-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c994ce4b912108eaef3f236d5684f55ef70b8501c1449ca5b1e89f864c67cfb
3
+ size 4893533208
Hunyuan-A52B-Instruct-FP8/model-00009-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad0fbbc4e3f5d5c2beb01c28f010d50d0fdef0f1da31963ed6f8d043138b05a4
3
+ size 4961115848
Hunyuan-A52B-Instruct-FP8/model-00010-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:129373a286a7753372a69432b582f751897bc3e8ae4ddb3aa7a6e96445299e01
3
+ size 4961500304
Hunyuan-A52B-Instruct-FP8/model-00011-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c8a23805f98451641cb02b21065a46839d2d2f732bd735ef4f330bcd21bfceb
3
+ size 4893533184
Hunyuan-A52B-Instruct-FP8/model-00012-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fdc3b719e758b640ea7318623212b517fa5395b674a0113f08cb9e01b10b0380
3
+ size 4885340544
Hunyuan-A52B-Instruct-FP8/model-00013-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:813a495ed8115ca9e8b8151d1b3ab8ac32292250f26aa5e40ea7e539de857ebe
3
+ size 4893533624
Hunyuan-A52B-Instruct-FP8/model-00014-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99db7c25f88a46043bffb7500c8379671596d8f5e9f3c4892a82918978d33c7d
3
+ size 4884930896
Hunyuan-A52B-Instruct-FP8/model-00015-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c653a924e70b1e5963985ba1ea73d4bff7bb450833c71b1eacf7f6712bd6747
3
+ size 4920539536
Hunyuan-A52B-Instruct-FP8/model-00016-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0524647adf429e312bb6c58d6e7d6c41e95e3dd79dc1881805c1057cee87dbab
3
+ size 4893533328
Hunyuan-A52B-Instruct-FP8/model-00017-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef95353e285c4edcf2203da8cbc796a0c923cfcd28f7dec96f954188c92b12b3
3
+ size 4885340672
Hunyuan-A52B-Instruct-FP8/model-00018-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de5ed4ac92b109df43bd21f6378eb5bd59321f3c1adac462ade563f3e2a02ad8
3
+ size 4893533352
Hunyuan-A52B-Instruct-FP8/model-00019-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39616a511b70623c9560e47af03093910e59106ef5140008967b33a72b1068e1
3
+ size 4885340680
Hunyuan-A52B-Instruct-FP8/model-00020-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e818dd5788a99b30250130b84df5dacf6f76968c767c16d239d3d9657db1fce
3
+ size 4920129824
Hunyuan-A52B-Instruct-FP8/model-00021-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39ca5671a15e7115a4942be29b5e7667e7cc49d699af27a707c1588866b0955d
3
+ size 4893533320
Hunyuan-A52B-Instruct-FP8/model-00022-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8dc0573a9ca15b77d8cb12e814e124c019cc730f55234f1618e07dbe76d04503
3
+ size 4885340664
Hunyuan-A52B-Instruct-FP8/model-00023-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:064a247e467d0dd62afa4d7eb83e2afc34b9035a220a004ba133e1f1b94be9ef
3
+ size 4893533360
Hunyuan-A52B-Instruct-FP8/model-00024-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43b297381f0d2da5b6c310e85e040f0e71d5fbbba15e483583c1431b09489a7d
3
+ size 4885340672
Hunyuan-A52B-Instruct-FP8/model-00025-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93a7ec7dc233be3a4036ba66fea5e16171482bec58cb3d8c26af5277434e796b
3
+ size 4920129824
Hunyuan-A52B-Instruct-FP8/model-00026-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ffa16013f5598d8ba7a3ba266b1297564d23946b7de6153b35c69bae4ff38aa8
3
+ size 4893533320
Hunyuan-A52B-Instruct-FP8/model-00027-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4e3798f3c6582ad814bfd75857142b0f9fab7ccfb384edce3ffad27af4380af
3
+ size 4885340664
Hunyuan-A52B-Instruct-FP8/model-00028-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f36cdd485b20a1dc8ca35c08f7599991dafc7a10d2f940812686b9923976336a
3
+ size 4893533352
Hunyuan-A52B-Instruct-FP8/model-00029-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de881689df08c8523033478f1f986a7bb36a4a2cd05f4381bc2716716deacc65
3
+ size 4885340672
Hunyuan-A52B-Instruct-FP8/model-00030-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0403b94b04886b25e7319322e5d1af7bcaaa569adc42e17e9e92e9fd9f8fdbb0
3
+ size 4920129832
Hunyuan-A52B-Instruct-FP8/model-00031-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a898f9606c9ec43f0350289de27508879ff80a4f2fc5a3646f9ba17171036f87
3
+ size 4893533328
Hunyuan-A52B-Instruct-FP8/model-00032-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a7073e84e21fe08e1bfbb4ec23eaedc8a4f60a86e9634850b2f588e7d36104b
3
+ size 4885340648
Hunyuan-A52B-Instruct-FP8/model-00033-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1e26619607cfb9ecf1e06451a5982a9993970d1dbd609174f973df8da72b579
3
+ size 4893533352
Hunyuan-A52B-Instruct-FP8/model-00034-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e32759f62718534c688bda81ff0fc7b5299b768d18e0d20206a406c620c7675
3
+ size 4885340680
Hunyuan-A52B-Instruct-FP8/model-00035-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aca0713595056cb9cb392f663044428e49e0fc08030f096272bfe118ede676dd
3
+ size 4893123544
Hunyuan-A52B-Instruct-FP8/model-00036-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e615f52c0ef4e0dbaa6eae2c2f6a6a5efa8a6f838ec55cefbfd32030b5469f78
3
+ size 4920539560
Hunyuan-A52B-Instruct-FP8/model-00037-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29f17d561a1fe91d57e6f55efef958f396a4ece55483da4a56273b3dd711e565
3
+ size 4885340648
Hunyuan-A52B-Instruct-FP8/model-00038-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ceebb116b86be704243309cbb7a46732ebe3d3bf2906c57f125dd40eee0a3036
3
+ size 4893533360
Hunyuan-A52B-Instruct-FP8/model-00039-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ebcaf4caf60115c0620aebe46c734e8d5c898dee88ac3165a0123624c12ad28
3
+ size 4885340672
Hunyuan-A52B-Instruct-FP8/model-00040-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a4207621c18e01bd8f9095bf99bf91c95854f2ee1a80e48bef255523c7545db
3
+ size 4893123552
Hunyuan-A52B-Instruct-FP8/model-00041-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4af57b9adb295cd534724c62caec0faaebb4b989aaf5fbe2d9a59317929e499d
3
+ size 4920539536
Hunyuan-A52B-Instruct-FP8/model-00042-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a2073a8eb463623997a5270daf62afcc5211c9c11e03f78d71561ebcc3efaef
3
+ size 4885340648
Hunyuan-A52B-Instruct-FP8/model-00043-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a863947df273b5401820a4e12a459d81f84d8e6b90ad8d75a07193752ce6deac
3
+ size 4893533344
Hunyuan-A52B-Instruct-FP8/model-00044-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccfee0ba313831c35767333f7e014e5a16cee05b6b6b890704d217aaf2b9639f
3
+ size 4885340672
Hunyuan-A52B-Instruct-FP8/model-00045-of-00080.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23b1f9b1a9aa89ec458467f659a2b498de272d3735e549998efc48975d2bcacb
3
+ size 4893533360