Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +1 -0
- chat_template.jinja +1 -0
- config.json +108 -0
- configuration_deepseek.py +210 -0
- generation_config.json +9 -0
- model-00001-of-00077.safetensors +3 -0
- model-00002-of-00077.safetensors +3 -0
- model-00003-of-00077.safetensors +3 -0
- model-00004-of-00077.safetensors +3 -0
- model-00005-of-00077.safetensors +3 -0
- model-00006-of-00077.safetensors +3 -0
- model-00007-of-00077.safetensors +3 -0
- model-00008-of-00077.safetensors +3 -0
- model-00009-of-00077.safetensors +3 -0
- model-00010-of-00077.safetensors +3 -0
- model-00011-of-00077.safetensors +3 -0
- model-00012-of-00077.safetensors +3 -0
- model-00013-of-00077.safetensors +3 -0
- model-00014-of-00077.safetensors +3 -0
- model-00015-of-00077.safetensors +3 -0
- model-00016-of-00077.safetensors +3 -0
- model-00017-of-00077.safetensors +3 -0
- model-00018-of-00077.safetensors +3 -0
- model-00019-of-00077.safetensors +3 -0
- model-00020-of-00077.safetensors +3 -0
- model-00021-of-00077.safetensors +3 -0
- model-00022-of-00077.safetensors +3 -0
- model-00023-of-00077.safetensors +3 -0
- model-00024-of-00077.safetensors +3 -0
- model-00025-of-00077.safetensors +3 -0
- model-00026-of-00077.safetensors +3 -0
- model-00027-of-00077.safetensors +3 -0
- model-00028-of-00077.safetensors +3 -0
- model-00029-of-00077.safetensors +3 -0
- model-00030-of-00077.safetensors +3 -0
- model-00031-of-00077.safetensors +3 -0
- model-00032-of-00077.safetensors +3 -0
- model-00033-of-00077.safetensors +3 -0
- model-00034-of-00077.safetensors +3 -0
- model-00035-of-00077.safetensors +3 -0
- model-00036-of-00077.safetensors +3 -0
- model-00037-of-00077.safetensors +3 -0
- model-00038-of-00077.safetensors +3 -0
- model-00039-of-00077.safetensors +3 -0
- model-00040-of-00077.safetensors +3 -0
- model-00041-of-00077.safetensors +3 -0
- model-00042-of-00077.safetensors +3 -0
- model-00043-of-00077.safetensors +3 -0
- model-00044-of-00077.safetensors +3 -0
- model-00045-of-00077.safetensors +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
|
|
|
|
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
|
36 |
+
model.safetensors.index.json filter=lfs diff=lfs merge=lfs -text
|
chat_template.jinja
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='', is_first_sp=true) %}{%- for message in messages %}{%- if message['role'] == 'system' %}{%- if ns.is_first_sp %}{% set ns.system_prompt = ns.system_prompt + message['content'] %}{% set ns.is_first_sp = false %}{%- else %}{% set ns.system_prompt = ns.system_prompt + '\n\n' + message['content'] %}{%- endif %}{%- endif %}{%- endfor %}{{ bos_token }}{{ ns.system_prompt }}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and 'tool_calls' in message %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls'] %}{%- if not ns.is_first %}{%- if message['content'] is none %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{%- else %}{{'<|Assistant|>' + message['content'] + '<|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{%- endif %}{%- set ns.is_first = true -%}{%- else %}{{'\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<|tool▁call▁end|>'}}{%- endif %}{%- endfor %}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- if message['role'] == 'assistant' and 'tool_calls' not in message %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\n'}}{% endif %}
|
config.json
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"head_dim": 64,
|
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 |
+
"pad_token_id": 128815,
|
37 |
+
"pretraining_tp": 1,
|
38 |
+
"q_lora_rank": 1536,
|
39 |
+
"qk_head_dim": 192,
|
40 |
+
"qk_nope_head_dim": 128,
|
41 |
+
"qk_rope_head_dim": 64,
|
42 |
+
"quantization_config": {
|
43 |
+
"config_groups": {
|
44 |
+
"group_0": {
|
45 |
+
"input_activations": {
|
46 |
+
"actorder": null,
|
47 |
+
"block_structure": null,
|
48 |
+
"dynamic": "local",
|
49 |
+
"group_size": 16,
|
50 |
+
"num_bits": 4,
|
51 |
+
"observer": "minmax",
|
52 |
+
"observer_kwargs": {},
|
53 |
+
"strategy": "tensor_group",
|
54 |
+
"symmetric": true,
|
55 |
+
"type": "float"
|
56 |
+
},
|
57 |
+
"output_activations": null,
|
58 |
+
"targets": [
|
59 |
+
"Linear"
|
60 |
+
],
|
61 |
+
"weights": {
|
62 |
+
"actorder": null,
|
63 |
+
"block_structure": null,
|
64 |
+
"dynamic": false,
|
65 |
+
"group_size": 16,
|
66 |
+
"num_bits": 4,
|
67 |
+
"observer": "minmax",
|
68 |
+
"observer_kwargs": {},
|
69 |
+
"strategy": "tensor_group",
|
70 |
+
"symmetric": true,
|
71 |
+
"type": "float"
|
72 |
+
}
|
73 |
+
}
|
74 |
+
},
|
75 |
+
"format": "nvfp4-pack-quantized",
|
76 |
+
"global_compression_ratio": null,
|
77 |
+
"ignore": [
|
78 |
+
"lm_head"
|
79 |
+
],
|
80 |
+
"kv_cache_scheme": null,
|
81 |
+
"quant_method": "compressed-tensors",
|
82 |
+
"quantization_status": "compressed"
|
83 |
+
},
|
84 |
+
"rms_norm_eps": 1e-06,
|
85 |
+
"rope_scaling": {
|
86 |
+
"beta_fast": 32,
|
87 |
+
"beta_slow": 1,
|
88 |
+
"factor": 40,
|
89 |
+
"mscale": 1.0,
|
90 |
+
"mscale_all_dim": 1.0,
|
91 |
+
"original_max_position_embeddings": 4096,
|
92 |
+
"type": "yarn"
|
93 |
+
},
|
94 |
+
"rope_theta": 10000,
|
95 |
+
"routed_scaling_factor": 2.5,
|
96 |
+
"scoring_func": "sigmoid",
|
97 |
+
"seq_aux": true,
|
98 |
+
"tie_word_embeddings": false,
|
99 |
+
"topk_group": 4,
|
100 |
+
"topk_method": "noaux_tc",
|
101 |
+
"torch_dtype": "bfloat16",
|
102 |
+
"transformers_version": "4.53.2",
|
103 |
+
"unsloth_fixed": true,
|
104 |
+
"use_cache": true,
|
105 |
+
"v_head_dim": 128,
|
106 |
+
"vocab_size": 129280
|
107 |
+
}
|
108 |
+
|
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.53.2"
|
9 |
+
}
|
model-00001-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5b3812226b243518b5d0a14aa4785d0f1ef222b210f4935d45555427aa4f3fc0
|
3 |
+
size 4999540808
|
model-00002-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:01c3667a6b436ff9f036feb722615a4e2099c3f856a88c7e52e5a86e67294ae0
|
3 |
+
size 4997638684
|
model-00003-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:aea52a480afbc8c96d6ebc4f52678c0789d8ba1947d691116cb7bf28d9ff6e62
|
3 |
+
size 4996038828
|
model-00004-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8f9875947da428e8579f41e78952cb0a9f13054156849a9ed7d81b1b7bd0479c
|
3 |
+
size 4997638148
|
model-00005-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f3e4bd5fe122e7d8287e2a3bf2aba491b12dc7a3f0c72417f9d76cc4174ff792
|
3 |
+
size 4997638140
|
model-00006-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:adeb8b404bdb985cbf9ec8604d3e49b1282dd56a7c03072f4ff76468a68068bb
|
3 |
+
size 4997638636
|
model-00007-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b9d3e4865317dd46e0f3863e5951e1ad54e6e18d30bc84ce76a143dab3c62d02
|
3 |
+
size 4996039028
|
model-00008-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7b4b4c4f0d2a35485fad3f5e0535608e6df1ea4939d98a2df9ed80e551659bd8
|
3 |
+
size 4997638148
|
model-00009-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d18f79548de08554d470c0d265d334f10b761bbd7345665dd1652a36e60c6329
|
3 |
+
size 4997638148
|
model-00010-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f5d49d05dc49ffe831fc6ab3e37a05b92e4c145ae4d28a0af422ee1dcb7b25b2
|
3 |
+
size 4997639052
|
model-00011-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:afaa9e91d81337c2e9bc0d016dfe97219d68945167a31217dd93696db609a419
|
3 |
+
size 4997640492
|
model-00012-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0fa6d618a6834fbd94ab6c7d88f0d9fd8946955268615b083ec6ec35aa311922
|
3 |
+
size 4996040500
|
model-00013-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b260108a0a40629488e7093061d50366d9c283403ea4d54936fc1dda9ebb80e3
|
3 |
+
size 4997639948
|
model-00014-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0ff89bfa01b03c4cac4e4c65cc97d7e633b6267ccf373df0d2ca489ea0006c4a
|
3 |
+
size 4997640028
|
model-00015-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:39f060810b2d142e036210cc4a5b666f28e7446d1dc5caca24e7368288acf535
|
3 |
+
size 4997640476
|
model-00016-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5c399816cc9c4a28f6bb9536aae06f81010021ea02e1dfdf1ff1420eb3e02075
|
3 |
+
size 4996040724
|
model-00017-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0a5ddad1c430017b100e51a87833bbf401330bb789b2b67b8f2f8c6ac4784399
|
3 |
+
size 4997639940
|
model-00018-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c400d06423e39e968b9cf2ba1d3139413cb7a28a08012d7e56be2ed79f778f0e
|
3 |
+
size 4997639948
|
model-00019-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:227e6b97e5874af28227519cc8a85d1c9f65000db0b8efff50ed341e90d62a6d
|
3 |
+
size 4997640356
|
model-00020-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0a694aafae207cf1cd53a64ec7107fbe9c4631392e3191963cdb8b5498c5dcb1
|
3 |
+
size 4999711676
|
model-00021-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:86659fa797f0d193ea18a1c85a34210b65852032841c7a2cd7a0042686cef112
|
3 |
+
size 4993969172
|
model-00022-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3cd438ded18583693e67edbc7067b3975dc68f59271f8cedbe7e0b1c9020fc13
|
3 |
+
size 4997639940
|
model-00023-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b09802a18c81d7338549acc7b5296cb45b5c958ed71748169fa80cdc7d3c5fec
|
3 |
+
size 4997640156
|
model-00024-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a92951120518182e29ed9a4b639c714c59c35b8c93684b06a1e8fa67ee693782
|
3 |
+
size 4997640484
|
model-00025-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b5750f8ac0f677a9d0a8fdf618c08af2ef002f097868a3a9578f82b51c06ceb6
|
3 |
+
size 4996040588
|
model-00026-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5205cacc77a15bc8095ec48315afc5e6524b73064d5acde289dae79b7fa3d6b4
|
3 |
+
size 4997639948
|
model-00027-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f294d043e7c871575eb5353ac12287a7478f48f4ca584d245ec4bdbd4dc2b266
|
3 |
+
size 4997639940
|
model-00028-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6182f51b455486dbdf473968b97043115d17d04a0e240b6705792f1da18e4645
|
3 |
+
size 4997640484
|
model-00029-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6514852b00d7b690b6022fd78a406516603c1a1fd8600d78805a913808344888
|
3 |
+
size 4996040788
|
model-00030-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:40dc11f34d284138f0b5778b2b8796a135a895644e3d7d49d502f5d135860eb8
|
3 |
+
size 4997639948
|
model-00031-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:74e706136a61ff7ce3ad360f848bd5f09305e15f048624ea7c9e66542aa67207
|
3 |
+
size 4997639948
|
model-00032-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4204820fb38ddeef4215609a371a51cebf7ba3f1c13a24c8782a6abbdb07c9f6
|
3 |
+
size 4997640276
|
model-00033-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c895105e502b88b1bff82c5c09f3e2a4afed04601b15c36faa8461b808f1f502
|
3 |
+
size 4997640548
|
model-00034-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:474ec4cfccbf588501025e7a368b8f645da2a23827a4187d06da56f070b7539f
|
3 |
+
size 4996040396
|
model-00035-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:690d4cbd8dedc99d558e7da159c02fdbc334c546692de5bc36a8ff519e526940
|
3 |
+
size 4997639948
|
model-00036-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f816ec6fbaf377507a42e013fa755fa52e550e0ef277917a11c45568e78cfa74
|
3 |
+
size 4997640076
|
model-00037-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:408b3434106f359394a56e15f0b0b160f84ee2b053212a59d64c7a05cf413488
|
3 |
+
size 4997640476
|
model-00038-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5b368aa4315679fd4bcb9fd769b04b2e3edd4c75cd7610733aa926c8b2c0acd6
|
3 |
+
size 4996040668
|
model-00039-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2c93d8226e7bfeff407b4ddaa33d88da8547d651081d19edd9a4a915bc294216
|
3 |
+
size 4997639940
|
model-00040-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3f931b1c938beb812e4f693ea62b6cc2628caf366418f2584b8c7ba314235f1e
|
3 |
+
size 4997639948
|
model-00041-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9893a647189a76f12068538eb479bec2227f96ec20733d3fcbb54eb4d56c5405
|
3 |
+
size 4997640412
|
model-00042-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1db4e682b6d1fa140e61edd574de29a143bde11cd2c5b8b07987779fea6f3033
|
3 |
+
size 4996040868
|
model-00043-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ba2c68f3a812e49ad1d7ae86fe5d0136d9e269f800cf70e8a6aed0121029d255
|
3 |
+
size 4997639948
|
model-00044-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:018ac45577ee5ec7d3f8b42b1e1710f13b639f27df4ad6d6b3943d39d8081303
|
3 |
+
size 4997639940
|
model-00045-of-00077.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4cce6bf9056980ab953c05936af8a574380a829c79ec7a46b2bd8b1138bcecd3
|
3 |
+
size 4997640204
|