Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- config.json +104 -0
- configuration_deepseek.py +210 -0
- generation_config.json +6 -0
- model-00001-of-00135.safetensors +3 -0
- model-00002-of-00135.safetensors +3 -0
- model-00003-of-00135.safetensors +3 -0
- model-00004-of-00135.safetensors +3 -0
- model-00005-of-00135.safetensors +3 -0
- model-00006-of-00135.safetensors +3 -0
- model-00007-of-00135.safetensors +3 -0
- model-00008-of-00135.safetensors +3 -0
- model-00009-of-00135.safetensors +3 -0
- model-00010-of-00135.safetensors +3 -0
- model-00011-of-00135.safetensors +3 -0
- model-00012-of-00135.safetensors +3 -0
- model-00013-of-00135.safetensors +3 -0
- model-00014-of-00135.safetensors +3 -0
- model-00015-of-00135.safetensors +3 -0
- model-00016-of-00135.safetensors +3 -0
- model-00017-of-00135.safetensors +3 -0
- model-00018-of-00135.safetensors +3 -0
- model-00019-of-00135.safetensors +3 -0
- model-00020-of-00135.safetensors +3 -0
- model-00021-of-00135.safetensors +3 -0
- model-00022-of-00135.safetensors +3 -0
- model-00023-of-00135.safetensors +3 -0
- model-00024-of-00135.safetensors +3 -0
- model-00025-of-00135.safetensors +3 -0
- model-00026-of-00135.safetensors +3 -0
- model-00027-of-00135.safetensors +3 -0
- model-00028-of-00135.safetensors +3 -0
- model-00029-of-00135.safetensors +3 -0
- model-00030-of-00135.safetensors +3 -0
- model-00031-of-00135.safetensors +3 -0
- model-00032-of-00135.safetensors +3 -0
- model-00033-of-00135.safetensors +3 -0
- model-00034-of-00135.safetensors +3 -0
- model-00035-of-00135.safetensors +3 -0
- model-00036-of-00135.safetensors +3 -0
- model-00037-of-00135.safetensors +3 -0
- model-00038-of-00135.safetensors +3 -0
- model-00039-of-00135.safetensors +3 -0
- model-00040-of-00135.safetensors +3 -0
- model-00041-of-00135.safetensors +3 -0
- model-00042-of-00135.safetensors +3 -0
- model-00043-of-00135.safetensors +3 -0
- model-00044-of-00135.safetensors +3 -0
- model-00045-of-00135.safetensors +3 -0
- model-00046-of-00135.safetensors +3 -0
- model-00047-of-00135.safetensors +3 -0
config.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "perplexity-ai/r1-1776",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"DeepseekV3ForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0,
|
| 8 |
+
"auto_map": {
|
| 9 |
+
"AutoConfig": "perplexity-ai/r1-1776--configuration_deepseek.DeepseekV3Config",
|
| 10 |
+
"AutoModel": "perplexity-ai/r1-1776--modeling_deepseek.DeepseekV3Model",
|
| 11 |
+
"AutoModelForCausalLM": "perplexity-ai/r1-1776--modeling_deepseek.DeepseekV3ForCausalLM"
|
| 12 |
+
},
|
| 13 |
+
"aux_loss_alpha": 0.001,
|
| 14 |
+
"bos_token_id": 0,
|
| 15 |
+
"eos_token_id": 1,
|
| 16 |
+
"ep_size": 1,
|
| 17 |
+
"first_k_dense_replace": 3,
|
| 18 |
+
"hidden_act": "silu",
|
| 19 |
+
"hidden_size": 7168,
|
| 20 |
+
"initializer_range": 0.02,
|
| 21 |
+
"intermediate_size": 18432,
|
| 22 |
+
"kv_lora_rank": 512,
|
| 23 |
+
"max_position_embeddings": 163840,
|
| 24 |
+
"model_type": "deepseek_v3",
|
| 25 |
+
"moe_intermediate_size": 2048,
|
| 26 |
+
"moe_layer_freq": 1,
|
| 27 |
+
"n_group": 8,
|
| 28 |
+
"n_routed_experts": 256,
|
| 29 |
+
"n_shared_experts": 1,
|
| 30 |
+
"norm_topk_prob": true,
|
| 31 |
+
"num_attention_heads": 128,
|
| 32 |
+
"num_experts_per_tok": 8,
|
| 33 |
+
"num_hidden_layers": 61,
|
| 34 |
+
"num_key_value_heads": 128,
|
| 35 |
+
"num_nextn_predict_layers": 1,
|
| 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 |
+
"config_groups": {
|
| 42 |
+
"group_0": {
|
| 43 |
+
"input_activations": {
|
| 44 |
+
"actorder": null,
|
| 45 |
+
"block_structure": null,
|
| 46 |
+
"dynamic": true,
|
| 47 |
+
"group_size": null,
|
| 48 |
+
"num_bits": 8,
|
| 49 |
+
"observer": null,
|
| 50 |
+
"observer_kwargs": {},
|
| 51 |
+
"strategy": "token",
|
| 52 |
+
"symmetric": true,
|
| 53 |
+
"type": "float"
|
| 54 |
+
},
|
| 55 |
+
"output_activations": null,
|
| 56 |
+
"targets": [
|
| 57 |
+
"Linear"
|
| 58 |
+
],
|
| 59 |
+
"weights": {
|
| 60 |
+
"actorder": null,
|
| 61 |
+
"block_structure": null,
|
| 62 |
+
"dynamic": false,
|
| 63 |
+
"group_size": null,
|
| 64 |
+
"num_bits": 8,
|
| 65 |
+
"observer": "minmax",
|
| 66 |
+
"observer_kwargs": {},
|
| 67 |
+
"strategy": "channel",
|
| 68 |
+
"symmetric": true,
|
| 69 |
+
"type": "float"
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
},
|
| 73 |
+
"format": "float-quantized",
|
| 74 |
+
"global_compression_ratio": 1.5956813664563134,
|
| 75 |
+
"ignore": [
|
| 76 |
+
"lm_head"
|
| 77 |
+
],
|
| 78 |
+
"kv_cache_scheme": null,
|
| 79 |
+
"quant_method": "compressed-tensors",
|
| 80 |
+
"quantization_status": "compressed"
|
| 81 |
+
},
|
| 82 |
+
"rms_norm_eps": 1e-06,
|
| 83 |
+
"rope_scaling": {
|
| 84 |
+
"beta_fast": 32,
|
| 85 |
+
"beta_slow": 1,
|
| 86 |
+
"factor": 40,
|
| 87 |
+
"mscale": 1,
|
| 88 |
+
"mscale_all_dim": 1,
|
| 89 |
+
"original_max_position_embeddings": 4096,
|
| 90 |
+
"type": "yarn"
|
| 91 |
+
},
|
| 92 |
+
"rope_theta": 10000,
|
| 93 |
+
"routed_scaling_factor": 2.5,
|
| 94 |
+
"scoring_func": "sigmoid",
|
| 95 |
+
"seq_aux": true,
|
| 96 |
+
"tie_word_embeddings": false,
|
| 97 |
+
"topk_group": 4,
|
| 98 |
+
"topk_method": "noaux_tc",
|
| 99 |
+
"torch_dtype": "bfloat16",
|
| 100 |
+
"transformers_version": "4.49.0",
|
| 101 |
+
"use_cache": true,
|
| 102 |
+
"v_head_dim": 128,
|
| 103 |
+
"vocab_size": 129280
|
| 104 |
+
}
|
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,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 1,
|
| 5 |
+
"transformers_version": "4.49.0"
|
| 6 |
+
}
|
model-00001-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f8fc574c9e10b3c6ddb3470b2588d946e889af353d5a7f0f63d63b44d336c2da
|
| 3 |
+
size 4996171248
|
model-00002-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9385b5bccd050a0f7f567c8774568965825ea2d825f99023b075b91d0be33137
|
| 3 |
+
size 4993855904
|
model-00003-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6db928aeb679813e2e836ad760eec8330c7586fc9a8ec7d9c13a6c48bd42583
|
| 3 |
+
size 4993866592
|
model-00004-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d7702496a564bea0b96716520fc01b34700718c2d77f47f6e812168ff23ec55a
|
| 3 |
+
size 4993861360
|
model-00005-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a76275e6c42e4d7896b80cfb11a4b5a46b6c1a2d5980126643945ede4adc94c8
|
| 3 |
+
size 4993856352
|
model-00006-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:53072024e2ba09f858d10a48d0b289e0e705fb32954166717b8516192718d15e
|
| 3 |
+
size 4993861312
|
model-00007-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8148ec9651fa14fc32f34678975fc51be6e25382e7b1cd01b21cac47c67fa429
|
| 3 |
+
size 4993856176
|
model-00008-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9c293917bf6a7825a0c5d4691d6c530d4429ce0f8039ed143654765d1006f6cf
|
| 3 |
+
size 4993861488
|
model-00009-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6c0b8ca407cf85b668f1f404ea6835083e3075ec4f0e1e4f8b3dbafd97b27d41
|
| 3 |
+
size 4993866208
|
model-00010-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1e9f937cf4b4ec7d5d414093c2e193bd9b599cecab05efc65c83bae45be5cb7c
|
| 3 |
+
size 4993861744
|
model-00011-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5b0d917c69b71c29674deaf331895b34be8dac87467f73c3bc8fcec85f1494f0
|
| 3 |
+
size 4993855712
|
model-00012-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3101ff1a2a139d983b6a2a0dae2d08fa19510180be18a15f89701bcb3706fb96
|
| 3 |
+
size 4993856352
|
model-00013-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ac7518fa8c4fb008ee1676961fd9cb005c1c3bab420698d734de447df06f2ac
|
| 3 |
+
size 4993861312
|
model-00014-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:45b5fdd7e54c0536867db977ce8e5cf297d21a565e0ed42fe91db5460895e06a
|
| 3 |
+
size 4993866472
|
model-00015-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f5edb84d761c6cdb35a4cf95ac130ee07d7b7589199fa07593003010925d9f69
|
| 3 |
+
size 4993861432
|
model-00016-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f3466bc0297dda19d98475ac5221ba9993f1276696de2f0fca9e051822b8e2e7
|
| 3 |
+
size 4993856024
|
model-00017-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f6d41d96e91d4ba4654a637816d942ee7ed1190386f7a46e0fb28c642b91b06
|
| 3 |
+
size 4993861752
|
model-00018-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4e8cc68a187db976cbff37a86a21411739239d86ee6a06008a093d043844620b
|
| 3 |
+
size 4993856488
|
model-00019-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ce6586375b4f0da5a66dfdb6d346f88444537c598c88750a6dc546f2e47a13d
|
| 3 |
+
size 4993867272
|
model-00020-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b8e03f38023d62a0ec38f5c7738e19e0f60fa918b42516956a3533780e3f172
|
| 3 |
+
size 4993861984
|
model-00021-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3ee25f97d6e2bd61059cdb3490fe680235d239085d3f4cf1b8f266e431d19fb0
|
| 3 |
+
size 4993856968
|
model-00022-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c20589bbf3f9c5e095c6d52654951e5705e3aff20c418a5e9c67962fe0b709c3
|
| 3 |
+
size 4993862040
|
model-00023-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d0ab2d7cae2203c5e1c6f38c3bb64210624fb0f2d3ffc5a25e9cc627573d75db
|
| 3 |
+
size 4993856760
|
model-00024-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:caefa7077fad1252ee08a3d31476c1113bbd5982bb3ed983be5e8c4aced11f4f
|
| 3 |
+
size 4993862248
|
model-00025-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bbeff0761b1a53fc04f7cf478d0c633567ba0c4cb57970ca3bc7a5327ef05fd9
|
| 3 |
+
size 4993866792
|
model-00026-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:de4075139039ea7b9810940cb2878fa418eee761025b97d9bb3e7d51a6f0ecb5
|
| 3 |
+
size 4993857032
|
model-00027-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81480e1a4734beed3f64c5a9cf7693ecb9e1e04971d3f571c62143cf44088450
|
| 3 |
+
size 4993861984
|
model-00028-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:77e016b9fd432d2afc61d885ed4dc188b144407b19a16c3743a341f8e2f99a3e
|
| 3 |
+
size 4993857024
|
model-00029-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49d2ff66460b1cbd34ae1e5ca1b417c57bbf8a639f392fcf905401c7ea51286c
|
| 3 |
+
size 4993861984
|
model-00030-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ab6256db64512d15a8f7bd80d113dab010222612908c166695d27991c36de41
|
| 3 |
+
size 4993867056
|
model-00031-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54494aab1efb32b033ad60a4ada287897dedf25d6df0a0b3a706a9e8d03299bd
|
| 3 |
+
size 4993862192
|
model-00032-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a211cc09f9e8feed08c837ac19b5616dc1a704dd6fc20f438be0d263dedb6ed8
|
| 3 |
+
size 4993856608
|
model-00033-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cc26fb0013862060735306409f8334b3e0f8af017967445df9aafbb0f7cd7e87
|
| 3 |
+
size 4997527784
|
model-00034-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad4605fa125ee9e68cd3b7edae6fc45515b1a1a7f8e6688f1e714a07bb8328d2
|
| 3 |
+
size 4990191024
|
model-00035-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ef628988c82aea19004ae9667df177857ce8cae0b7ae14a002f7903f1cec0341
|
| 3 |
+
size 4993867272
|
model-00036-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5824dfc6e6bb34bb5313047fcacf7f7039b8f9a46af299376aa7087af56a4ece
|
| 3 |
+
size 4993861984
|
model-00037-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:928ab28affadcb2032091ab42a948f4b746fd047fca565041774e7bee05281c3
|
| 3 |
+
size 4993856872
|
model-00038-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d3940b4be1d38b489ab4f36453e7026bf5956b7e59f905a99f070da40d13b36d
|
| 3 |
+
size 4993862136
|
model-00039-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:09b4ac136116396e76416a67fff1a49cc947a53542be2e2d0d27842916d2ccc7
|
| 3 |
+
size 4993856664
|
model-00040-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:705ec3e2ccbc2dcd6359a0c81f7297e5fa112a63bf9f3b0959e59c51727ef5db
|
| 3 |
+
size 4993862376
|
model-00041-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:82b61dd7218b955ca02324d0cde85799bdc2e52b5ab29d970d85caf0f9839e84
|
| 3 |
+
size 4993866664
|
model-00042-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bcc8921721ba42a0b0f8844106923f43263abcf9c010806ef372d51d0c38ae3c
|
| 3 |
+
size 4993857032
|
model-00043-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cff7ed3c7c76909d5d98ba2305b395952123f0e1a796c7273a9995b6607ded18
|
| 3 |
+
size 4993861984
|
model-00044-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:28f0425be7b4ad61ae0be2b19d36831c787bcad3b466803d4563f320e80fac3f
|
| 3 |
+
size 4993856928
|
model-00045-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9384fae2b253c85edc4311bc4cb8e953a387b37efc84c9b1af1072ba75fb413e
|
| 3 |
+
size 4993862080
|
model-00046-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:328a6ccfccbff46bbad1327ae2c4dc7e020a8341a9fcff94b561227e1e304dca
|
| 3 |
+
size 4993866960
|
model-00047-of-00135.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:21378ff3a76e0508a01921fef1d7c72c91ddbbb1d20358f1a9a40ec020769286
|
| 3 |
+
size 4993862288
|