upload model (#1)
Browse files- upload deepseek-r1 with attention quant (8770d545f90e3414f23551acc12c6154aacaddfb)
This view is limited to 50 files because it contains too many changes.
See raw diff
- config.json +118 -0
- configuration_deepseek.py +210 -0
- generation_config.json +9 -0
- model-00001-of-00072.safetensors +3 -0
- model-00002-of-00072.safetensors +3 -0
- model-00003-of-00072.safetensors +3 -0
- model-00004-of-00072.safetensors +3 -0
- model-00005-of-00072.safetensors +3 -0
- model-00006-of-00072.safetensors +3 -0
- model-00007-of-00072.safetensors +3 -0
- model-00008-of-00072.safetensors +3 -0
- model-00009-of-00072.safetensors +3 -0
- model-00010-of-00072.safetensors +3 -0
- model-00011-of-00072.safetensors +3 -0
- model-00012-of-00072.safetensors +3 -0
- model-00013-of-00072.safetensors +3 -0
- model-00014-of-00072.safetensors +3 -0
- model-00015-of-00072.safetensors +3 -0
- model-00016-of-00072.safetensors +3 -0
- model-00017-of-00072.safetensors +3 -0
- model-00018-of-00072.safetensors +3 -0
- model-00019-of-00072.safetensors +3 -0
- model-00020-of-00072.safetensors +3 -0
- model-00021-of-00072.safetensors +3 -0
- model-00022-of-00072.safetensors +3 -0
- model-00023-of-00072.safetensors +3 -0
- model-00024-of-00072.safetensors +3 -0
- model-00025-of-00072.safetensors +3 -0
- model-00026-of-00072.safetensors +3 -0
- model-00027-of-00072.safetensors +3 -0
- model-00028-of-00072.safetensors +3 -0
- model-00029-of-00072.safetensors +3 -0
- model-00030-of-00072.safetensors +3 -0
- model-00031-of-00072.safetensors +3 -0
- model-00032-of-00072.safetensors +3 -0
- model-00033-of-00072.safetensors +3 -0
- model-00034-of-00072.safetensors +3 -0
- model-00035-of-00072.safetensors +3 -0
- model-00036-of-00072.safetensors +3 -0
- model-00037-of-00072.safetensors +3 -0
- model-00038-of-00072.safetensors +3 -0
- model-00039-of-00072.safetensors +3 -0
- model-00040-of-00072.safetensors +3 -0
- model-00041-of-00072.safetensors +3 -0
- model-00042-of-00072.safetensors +3 -0
- model-00043-of-00072.safetensors +3 -0
- model-00044-of-00072.safetensors +3 -0
- model-00045-of-00072.safetensors +3 -0
- model-00046-of-00072.safetensors +3 -0
- model-00047-of-00072.safetensors +3 -0
config.json
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DeepseekV3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_deepseek.DeepseekV3Config",
|
| 9 |
+
"AutoModel": "modeling_deepseek.DeepseekV3Model",
|
| 10 |
+
"AutoModelForCausalLM": "modeling_deepseek.DeepseekV3ForCausalLM"
|
| 11 |
+
},
|
| 12 |
+
"aux_loss_alpha": 0.001,
|
| 13 |
+
"bos_token_id": 0,
|
| 14 |
+
"eos_token_id": 1,
|
| 15 |
+
"ep_size": 1,
|
| 16 |
+
"first_k_dense_replace": 3,
|
| 17 |
+
"hidden_act": "silu",
|
| 18 |
+
"hidden_size": 7168,
|
| 19 |
+
"initializer_range": 0.02,
|
| 20 |
+
"intermediate_size": 18432,
|
| 21 |
+
"kv_lora_rank": 512,
|
| 22 |
+
"max_position_embeddings": 163840,
|
| 23 |
+
"model_type": "deepseek_v3",
|
| 24 |
+
"moe_intermediate_size": 2048,
|
| 25 |
+
"moe_layer_freq": 1,
|
| 26 |
+
"n_group": 8,
|
| 27 |
+
"n_routed_experts": 256,
|
| 28 |
+
"n_shared_experts": 1,
|
| 29 |
+
"norm_topk_prob": true,
|
| 30 |
+
"num_attention_heads": 128,
|
| 31 |
+
"num_experts_per_tok": 8,
|
| 32 |
+
"num_hidden_layers": 61,
|
| 33 |
+
"num_key_value_heads": 128,
|
| 34 |
+
"num_nextn_predict_layers": 1,
|
| 35 |
+
"pad_token_id": 128815,
|
| 36 |
+
"pretraining_tp": 1,
|
| 37 |
+
"q_lora_rank": 1536,
|
| 38 |
+
"qk_nope_head_dim": 128,
|
| 39 |
+
"qk_rope_head_dim": 64,
|
| 40 |
+
"quantization_config": {
|
| 41 |
+
"algo_config": null,
|
| 42 |
+
"exclude": [
|
| 43 |
+
"lm_head"
|
| 44 |
+
],
|
| 45 |
+
"export": {
|
| 46 |
+
"kv_cache_group": [],
|
| 47 |
+
"min_kv_scale": 0.0,
|
| 48 |
+
"pack_method": "reorder",
|
| 49 |
+
"weight_format": "real_quantized",
|
| 50 |
+
"weight_merge_groups": null
|
| 51 |
+
},
|
| 52 |
+
"global_quant_config": {
|
| 53 |
+
"bias": null,
|
| 54 |
+
"input_tensors": {
|
| 55 |
+
"ch_axis": -1,
|
| 56 |
+
"dtype": "fp4",
|
| 57 |
+
"group_size": 32,
|
| 58 |
+
"is_dynamic": true,
|
| 59 |
+
"is_mx_scale_constraint": false,
|
| 60 |
+
"is_scale_quant": false,
|
| 61 |
+
"mx_element_dtype": null,
|
| 62 |
+
"observer_cls": "PerBlockMXObserver",
|
| 63 |
+
"qscheme": "per_group",
|
| 64 |
+
"round_method": "half_even",
|
| 65 |
+
"scale_calculation_mode": "even",
|
| 66 |
+
"scale_format": "e8m0",
|
| 67 |
+
"scale_type": "float",
|
| 68 |
+
"symmetric": null
|
| 69 |
+
},
|
| 70 |
+
"output_tensors": null,
|
| 71 |
+
"target_device": null,
|
| 72 |
+
"weight": {
|
| 73 |
+
"ch_axis": -1,
|
| 74 |
+
"dtype": "fp4",
|
| 75 |
+
"group_size": 32,
|
| 76 |
+
"is_dynamic": false,
|
| 77 |
+
"is_mx_scale_constraint": false,
|
| 78 |
+
"is_scale_quant": false,
|
| 79 |
+
"mx_element_dtype": null,
|
| 80 |
+
"observer_cls": "PerBlockMXObserver",
|
| 81 |
+
"qscheme": "per_group",
|
| 82 |
+
"round_method": "half_even",
|
| 83 |
+
"scale_calculation_mode": "even",
|
| 84 |
+
"scale_format": "e8m0",
|
| 85 |
+
"scale_type": "float",
|
| 86 |
+
"symmetric": null
|
| 87 |
+
}
|
| 88 |
+
},
|
| 89 |
+
"layer_quant_config": {},
|
| 90 |
+
"layer_type_quant_config": {},
|
| 91 |
+
"quant_method": "quark",
|
| 92 |
+
"quant_mode": "eager_mode",
|
| 93 |
+
"softmax_quant_spec": null
|
| 94 |
+
},
|
| 95 |
+
"rms_norm_eps": 1e-06,
|
| 96 |
+
"rope_scaling": {
|
| 97 |
+
"beta_fast": 32,
|
| 98 |
+
"beta_slow": 1,
|
| 99 |
+
"factor": 40,
|
| 100 |
+
"mscale": 1.0,
|
| 101 |
+
"mscale_all_dim": 1.0,
|
| 102 |
+
"original_max_position_embeddings": 4096,
|
| 103 |
+
"type": "yarn"
|
| 104 |
+
},
|
| 105 |
+
"rope_theta": 10000,
|
| 106 |
+
"routed_scaling_factor": 2.5,
|
| 107 |
+
"scoring_func": "sigmoid",
|
| 108 |
+
"seq_aux": true,
|
| 109 |
+
"tie_word_embeddings": false,
|
| 110 |
+
"topk_group": 4,
|
| 111 |
+
"topk_method": "noaux_tc",
|
| 112 |
+
"torch_dtype": "bfloat16",
|
| 113 |
+
"transformers_version": "4.51.0",
|
| 114 |
+
"unsloth_fixed": true,
|
| 115 |
+
"use_cache": true,
|
| 116 |
+
"v_head_dim": 128,
|
| 117 |
+
"vocab_size": 129280
|
| 118 |
+
}
|
configuration_deepseek.py
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 2 |
+
from transformers.utils import logging
|
| 3 |
+
|
| 4 |
+
logger = logging.get_logger(__name__)
|
| 5 |
+
|
| 6 |
+
DEEPSEEK_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
|
| 7 |
+
class DeepseekV3Config(PretrainedConfig):
|
| 8 |
+
r"""
|
| 9 |
+
This is the configuration class to store the configuration of a [`DeepseekV3Model`]. It is used to instantiate an DeepSeek
|
| 10 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
| 11 |
+
defaults will yield a similar configuration to that of the DeepSeek-V3.
|
| 12 |
+
|
| 13 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
| 14 |
+
documentation from [`PretrainedConfig`] for more information.
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
Args:
|
| 18 |
+
vocab_size (`int`, *optional*, defaults to 129280):
|
| 19 |
+
Vocabulary size of the Deep model. Defines the number of different tokens that can be represented by the
|
| 20 |
+
`inputs_ids` passed when calling [`DeepseekV3Model`]
|
| 21 |
+
hidden_size (`int`, *optional*, defaults to 4096):
|
| 22 |
+
Dimension of the hidden representations.
|
| 23 |
+
intermediate_size (`int`, *optional*, defaults to 11008):
|
| 24 |
+
Dimension of the MLP representations.
|
| 25 |
+
moe_intermediate_size (`int`, *optional*, defaults to 1407):
|
| 26 |
+
Dimension of the MoE representations.
|
| 27 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
| 28 |
+
Number of hidden layers in the Transformer decoder.
|
| 29 |
+
num_nextn_predict_layers (`int`, *optional*, defaults to 1):
|
| 30 |
+
Number of nextn predict layers in the DeepSeekV3 Model.
|
| 31 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
| 32 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
| 33 |
+
n_shared_experts (`int`, *optional*, defaults to None):
|
| 34 |
+
Number of shared experts, None means dense model.
|
| 35 |
+
n_routed_experts (`int`, *optional*, defaults to None):
|
| 36 |
+
Number of routed experts, None means dense model.
|
| 37 |
+
routed_scaling_factor (`float`, *optional*, defaults to 1.0):
|
| 38 |
+
Scaling factor or routed experts.
|
| 39 |
+
topk_method (`str`, *optional*, defaults to `gready`):
|
| 40 |
+
Topk method used in routed gate.
|
| 41 |
+
n_group (`int`, *optional*, defaults to None):
|
| 42 |
+
Number of groups for routed experts.
|
| 43 |
+
topk_group (`int`, *optional*, defaults to None):
|
| 44 |
+
Number of selected groups for each token(for each token, ensuring the selected experts is only within `topk_group` groups).
|
| 45 |
+
num_experts_per_tok (`int`, *optional*, defaults to None):
|
| 46 |
+
Number of selected experts, None means dense model.
|
| 47 |
+
moe_layer_freq (`int`, *optional*, defaults to 1):
|
| 48 |
+
The frequency of the MoE layer: one expert layer for every `moe_layer_freq - 1` dense layers.
|
| 49 |
+
first_k_dense_replace (`int`, *optional*, defaults to 0):
|
| 50 |
+
Number of dense layers in shallow layers(embed->dense->dense->...->dense->moe->moe...->lm_head).
|
| 51 |
+
\--k dense layers--/
|
| 52 |
+
norm_topk_prob (`bool`, *optional*, defaults to False):
|
| 53 |
+
Whether to normalize the weights of the routed experts.
|
| 54 |
+
scoring_func (`str`, *optional*, defaults to 'softmax'):
|
| 55 |
+
Method of computing expert weights.
|
| 56 |
+
aux_loss_alpha (`float`, *optional*, defaults to 0.001):
|
| 57 |
+
Auxiliary loss weight coefficient.
|
| 58 |
+
seq_aux = (`bool`, *optional*, defaults to True):
|
| 59 |
+
Whether to compute the auxiliary loss for each individual sample.
|
| 60 |
+
num_key_value_heads (`int`, *optional*):
|
| 61 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
| 62 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
| 63 |
+
`num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
| 64 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
| 65 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
| 66 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
| 67 |
+
`num_attention_heads`.
|
| 68 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
| 69 |
+
The non-linear activation function (function or string) in the decoder.
|
| 70 |
+
max_position_embeddings (`int`, *optional*, defaults to 2048):
|
| 71 |
+
The maximum sequence length that this model might ever be used with.
|
| 72 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
| 73 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
| 74 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-06):
|
| 75 |
+
The epsilon used by the rms normalization layers.
|
| 76 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
| 77 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
| 78 |
+
relevant if `config.is_decoder=True`.
|
| 79 |
+
pad_token_id (`int`, *optional*):
|
| 80 |
+
Padding token id.
|
| 81 |
+
bos_token_id (`int`, *optional*, defaults to 1):
|
| 82 |
+
Beginning of stream token id.
|
| 83 |
+
eos_token_id (`int`, *optional*, defaults to 2):
|
| 84 |
+
End of stream token id.
|
| 85 |
+
pretraining_tp (`int`, *optional*, defaults to 1):
|
| 86 |
+
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
|
| 87 |
+
document](https://huggingface.co/docs/transformers/parallelism) to understand more about it. This value is
|
| 88 |
+
necessary to ensure exact reproducibility of the pretraining results. Please refer to [this
|
| 89 |
+
issue](https://github.com/pytorch/pytorch/issues/76232).
|
| 90 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
| 91 |
+
Whether to tie weight embeddings
|
| 92 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
| 93 |
+
The base period of the RoPE embeddings.
|
| 94 |
+
rope_scaling (`Dict`, *optional*):
|
| 95 |
+
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
|
| 96 |
+
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
|
| 97 |
+
`{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
|
| 98 |
+
`max_position_embeddings` to the expected new maximum.
|
| 99 |
+
attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
|
| 100 |
+
Whether to use a bias in the query, key, value and output projection layers during self-attention.
|
| 101 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
| 102 |
+
The dropout ratio for the attention probabilities.
|
| 103 |
+
|
| 104 |
+
```python
|
| 105 |
+
>>> from transformers import DeepseekV3Model, DeepseekV3Config
|
| 106 |
+
|
| 107 |
+
>>> # Initializing a Deepseek-V3 style configuration
|
| 108 |
+
>>> configuration = DeepseekV3Config()
|
| 109 |
+
|
| 110 |
+
>>> # Accessing the model configuration
|
| 111 |
+
>>> configuration = model.config
|
| 112 |
+
```"""
|
| 113 |
+
|
| 114 |
+
model_type = "deepseek_v3"
|
| 115 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 116 |
+
|
| 117 |
+
def __init__(
|
| 118 |
+
self,
|
| 119 |
+
vocab_size=129280,
|
| 120 |
+
hidden_size=7168,
|
| 121 |
+
intermediate_size=18432,
|
| 122 |
+
moe_intermediate_size = 2048,
|
| 123 |
+
num_hidden_layers=61,
|
| 124 |
+
num_nextn_predict_layers=1,
|
| 125 |
+
num_attention_heads=128,
|
| 126 |
+
num_key_value_heads=128,
|
| 127 |
+
n_shared_experts = 1,
|
| 128 |
+
n_routed_experts = 256,
|
| 129 |
+
ep_size = 1,
|
| 130 |
+
routed_scaling_factor = 2.5,
|
| 131 |
+
kv_lora_rank = 512,
|
| 132 |
+
q_lora_rank = 1536,
|
| 133 |
+
qk_rope_head_dim = 64,
|
| 134 |
+
v_head_dim = 128,
|
| 135 |
+
qk_nope_head_dim = 128,
|
| 136 |
+
topk_method = 'noaux_tc',
|
| 137 |
+
n_group = 8,
|
| 138 |
+
topk_group = 4,
|
| 139 |
+
num_experts_per_tok = 8,
|
| 140 |
+
moe_layer_freq = 1,
|
| 141 |
+
first_k_dense_replace = 3,
|
| 142 |
+
norm_topk_prob = True,
|
| 143 |
+
scoring_func = 'sigmoid',
|
| 144 |
+
aux_loss_alpha = 0.001,
|
| 145 |
+
seq_aux = True,
|
| 146 |
+
hidden_act="silu",
|
| 147 |
+
max_position_embeddings=4096,
|
| 148 |
+
initializer_range=0.02,
|
| 149 |
+
rms_norm_eps=1e-6,
|
| 150 |
+
use_cache=True,
|
| 151 |
+
pad_token_id=None,
|
| 152 |
+
bos_token_id=0,
|
| 153 |
+
eos_token_id=1,
|
| 154 |
+
pretraining_tp=1,
|
| 155 |
+
tie_word_embeddings=False,
|
| 156 |
+
rope_theta=10000.0,
|
| 157 |
+
rope_scaling=None,
|
| 158 |
+
attention_bias=False,
|
| 159 |
+
attention_dropout=0.0,
|
| 160 |
+
**kwargs,
|
| 161 |
+
):
|
| 162 |
+
self.vocab_size = vocab_size
|
| 163 |
+
self.max_position_embeddings = max_position_embeddings
|
| 164 |
+
self.hidden_size = hidden_size
|
| 165 |
+
self.intermediate_size = intermediate_size
|
| 166 |
+
self.moe_intermediate_size = moe_intermediate_size
|
| 167 |
+
self.num_hidden_layers = num_hidden_layers
|
| 168 |
+
self.num_nextn_predict_layers = num_nextn_predict_layers
|
| 169 |
+
self.num_attention_heads = num_attention_heads
|
| 170 |
+
self.n_shared_experts = n_shared_experts
|
| 171 |
+
self.n_routed_experts = n_routed_experts
|
| 172 |
+
self.ep_size = ep_size
|
| 173 |
+
self.routed_scaling_factor = routed_scaling_factor
|
| 174 |
+
self.kv_lora_rank = kv_lora_rank
|
| 175 |
+
self.q_lora_rank = q_lora_rank
|
| 176 |
+
self.qk_rope_head_dim = qk_rope_head_dim
|
| 177 |
+
self.v_head_dim = v_head_dim
|
| 178 |
+
self.qk_nope_head_dim = qk_nope_head_dim
|
| 179 |
+
self.topk_method = topk_method
|
| 180 |
+
self.n_group = n_group
|
| 181 |
+
self.topk_group = topk_group
|
| 182 |
+
self.num_experts_per_tok = num_experts_per_tok
|
| 183 |
+
self.moe_layer_freq = moe_layer_freq
|
| 184 |
+
self.first_k_dense_replace = first_k_dense_replace
|
| 185 |
+
self.norm_topk_prob = norm_topk_prob
|
| 186 |
+
self.scoring_func = scoring_func
|
| 187 |
+
self.aux_loss_alpha = aux_loss_alpha
|
| 188 |
+
self.seq_aux = seq_aux
|
| 189 |
+
# for backward compatibility
|
| 190 |
+
if num_key_value_heads is None:
|
| 191 |
+
num_key_value_heads = num_attention_heads
|
| 192 |
+
|
| 193 |
+
self.num_key_value_heads = num_key_value_heads
|
| 194 |
+
self.hidden_act = hidden_act
|
| 195 |
+
self.initializer_range = initializer_range
|
| 196 |
+
self.rms_norm_eps = rms_norm_eps
|
| 197 |
+
self.pretraining_tp = pretraining_tp
|
| 198 |
+
self.use_cache = use_cache
|
| 199 |
+
self.rope_theta = rope_theta
|
| 200 |
+
self.rope_scaling = rope_scaling
|
| 201 |
+
self.attention_bias = attention_bias
|
| 202 |
+
self.attention_dropout = attention_dropout
|
| 203 |
+
|
| 204 |
+
super().__init__(
|
| 205 |
+
pad_token_id=pad_token_id,
|
| 206 |
+
bos_token_id=bos_token_id,
|
| 207 |
+
eos_token_id=eos_token_id,
|
| 208 |
+
tie_word_embeddings=tie_word_embeddings,
|
| 209 |
+
**kwargs,
|
| 210 |
+
)
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"do_sample": true,
|
| 5 |
+
"eos_token_id": 1,
|
| 6 |
+
"temperature": 0.6,
|
| 7 |
+
"top_p": 0.95,
|
| 8 |
+
"transformers_version": "4.51.0"
|
| 9 |
+
}
|
model-00001-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4697c08adc2e6e74c2c098b67f8b309e15050550be0cd48d9525d1e2e8dbdcb2
|
| 3 |
+
size 4996307368
|
model-00002-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5623b835d867239db912d7c558bd01f1df3ab77a97ce51e20717d106a6cf6729
|
| 3 |
+
size 4993099120
|
model-00003-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4251680ca3b0ddfb7508690f0878bc11e55bf0febdbf811fcbc11b0b885ea3cc
|
| 3 |
+
size 4999180768
|
model-00004-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:68678aa3bf8a387ece7337ccee424334eac4f6cd2db0a52263ad52a226599cff
|
| 3 |
+
size 4993098832
|
model-00005-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2783d73dc0b9b09ff13e1b983a82b5be085aeaae7308bd2674b8ce1e72f5d121
|
| 3 |
+
size 4993098832
|
model-00006-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:841ce05f0366168a03e1dcb694aa56fe7979eda56556c12cf556b460c8a4300e
|
| 3 |
+
size 4993098832
|
model-00007-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9bd735e0b8d11a39b2938b9bf85459f1796bf55981c9ac15f0a8486c2bc78f86
|
| 3 |
+
size 4993099048
|
model-00008-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dabc8d920c19156deb50d57b6cddb480060f5c6ff0fd9b7742f78d2c5f492a2c
|
| 3 |
+
size 4993099120
|
model-00009-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b3f76d2f4e06742c6df86267a8f0ba9d0b523c58b3af45b7691854df87c31ba2
|
| 3 |
+
size 4999180616
|
model-00010-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:01234d4d57bfe078fc2c77255e960fba4d34cc33f7f1dff48e09bbe6c7916a46
|
| 3 |
+
size 4993099920
|
model-00011-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3d80d1ff50b093bacee923903f676f1a9dc93adbaafaa1c994d33cb0fdacb88f
|
| 3 |
+
size 4993100104
|
model-00012-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1aaf3d086fc9cd22607a8f3b01e02fd6abc3c834b36c54bb12da764cfbe72787
|
| 3 |
+
size 4993100184
|
model-00013-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6ab51ed615e904bebb4fa2826e034230506b1e2e45fbedda997303bd2b15a70
|
| 3 |
+
size 4993100392
|
model-00014-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9a0c5153a7ce6f20624bc3d19663faa891c0b41b0d565c97b636cb407ee48922
|
| 3 |
+
size 4999182032
|
model-00015-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3da908cc65c92aaed91bfb26313402ecf91b8724d5bc35bef80cd9d3012a0542
|
| 3 |
+
size 4993100104
|
model-00016-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5611038410d7e54e11929f0a608d9c782daaf34bb2fc9cbe437976a80d1e7a93
|
| 3 |
+
size 4993100104
|
model-00017-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e561b78520665b7e37e3cb1a5c59d13f0921d7b0218af10ca241322bab59a5ed
|
| 3 |
+
size 4993100104
|
model-00018-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f5484b7267bc1e32f43bced1daafd485bcddf82950e2a22a43e60cf6693c00b0
|
| 3 |
+
size 4993100344
|
model-00019-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a2a223251fa5a79632bff5addb6606e4d4cb1b23a29bfb04d4a656e8c591961d
|
| 3 |
+
size 4993100392
|
model-00020-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dc2767e1a786b8f2986dcc9f9a3f88f62e7e362346eb43888b62bc3ed9d4949a
|
| 3 |
+
size 4999181864
|
model-00021-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dd49c22134c7bfa27854fa5814c2547b2aba9bef1e3b1d126197923c1240b58c
|
| 3 |
+
size 4993100104
|
model-00022-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:32fc64f2c59d693a0e242b897482a2aa6d334064469fea3bb539db75e029a946
|
| 3 |
+
size 4993100104
|
model-00023-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b18016f9905f66e75d9d633d55cf9cb4bad473d0220d4c70aab3a68c5b5aca05
|
| 3 |
+
size 4993100216
|
model-00024-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fec67fc0afec505b2261f01717881e16e0e03f132b59aca409ec4458bf67243e
|
| 3 |
+
size 4993100392
|
model-00025-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6c1c37b21f5bf39fd48f031b632267580f0e9a29a8be45195d6ad5f6508a09a6
|
| 3 |
+
size 4999182000
|
model-00026-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d817e06ec3039b8310c7c62c001c6891c2acd4264022f8218c1e5a1b4955452
|
| 3 |
+
size 4993100104
|
model-00027-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:70f4d6118c3c5b7124db36c77c030db83766efea4dee4de2dfaeb031f221fa6c
|
| 3 |
+
size 4993100104
|
model-00028-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db7ca2deb4e66ccc216c221c331d6e241545e041176e492c636a0ae67b207fce
|
| 3 |
+
size 4993100104
|
model-00029-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a26fa211025395954575922f9477f87b51b272fb48048c00c8904dffba5c47dc
|
| 3 |
+
size 4993100376
|
model-00030-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a33529d422639e7f1d6ce3c1504795f6f714672bb4340a3d1ea6948a49c762d
|
| 3 |
+
size 4993100408
|
model-00031-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1714d2fc08b7a1169705ce4facc5adc8e1f9f3c8f3ead707e8eb44dcd5349b8
|
| 3 |
+
size 4999181824
|
model-00032-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1370f8f6a7617cafec441c7429701b266457f1045318ad755d3d7b591ca83cd9
|
| 3 |
+
size 4993100104
|
model-00033-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1692776fe43df58c3b0fbef8dd015745781fe5c7effa757ca7f025ccbf7155b6
|
| 3 |
+
size 4993100104
|
model-00034-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:056dc227d0acec93a0509c5c1f61470e9d5cd4e548da030022c80025c3cebab3
|
| 3 |
+
size 4993100240
|
model-00035-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fe43f0e8a3f6b3dc0189cd706684c9365d59887c6f23c42e6d8c2e173362ae2d
|
| 3 |
+
size 4993100392
|
model-00036-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:84584b75d6724f4e4248fad43dbaaf8899141d52fc45d787c304d59457e6bbce
|
| 3 |
+
size 4999181968
|
model-00037-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:caad7d122e740e9920737b363be369aed5e219dc07d1bafba6b0cb8440bbaa3e
|
| 3 |
+
size 4993100104
|
model-00038-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a6a605ba32c4034657bd4a7c1befc127bfd007200700932c430564d5006a312d
|
| 3 |
+
size 4993100104
|
model-00039-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6b7feed15efdf00eb70de40455aad45c238830720631e0510d558058e450c852
|
| 3 |
+
size 4993100112
|
model-00040-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:049adacedefbfd08c91fa6a19bcd5fb5fbd7d21edf4bdb55cb41895dc8087e52
|
| 3 |
+
size 4993100392
|
model-00041-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2facbfeeee95c00255145843649be0ae12803ffefb9523bdab8536b199effccf
|
| 3 |
+
size 4993100440
|
model-00042-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:690bceae931176a8c94d8a1a05e2d99971a14855922a122b65ce5caa8237627a
|
| 3 |
+
size 4999181768
|
model-00043-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:72a10008c46003980fac6c245c9d9b2b6ac6af5743c32d3f7d4a0376786f9c3f
|
| 3 |
+
size 4993100104
|
model-00044-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8058dad1c1cd7aa5eeb63a0b61c3b8a07bb16b1fb240c67ed539f42d5b87ec55
|
| 3 |
+
size 4993100104
|
model-00045-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:055119981b75c67598aebf3bc8acddfbf3e4da0b471b70b30e08e4dbc791d136
|
| 3 |
+
size 4993100272
|
model-00046-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:37e2fe59e6d2469e94705100de901172616d7a1d212277645bb2396dcf21cb31
|
| 3 |
+
size 4993100392
|
model-00047-of-00072.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cba4d938ab31206dd49ff31bedd8dcb282e4d1d572c1f547c084fd8af08b91a5
|
| 3 |
+
size 4999181944
|