This view is limited to 50 files because it contains too many changes.  See the raw diff here.
Files changed (50) hide show
  1. chat_template.jinja +101 -0
  2. config.json +118 -0
  3. configuration_deepseek.py +199 -0
  4. generation_config.json +9 -0
  5. model-00001-of-00138.safetensors +3 -0
  6. model-00002-of-00138.safetensors +3 -0
  7. model-00003-of-00138.safetensors +3 -0
  8. model-00004-of-00138.safetensors +3 -0
  9. model-00005-of-00138.safetensors +3 -0
  10. model-00006-of-00138.safetensors +3 -0
  11. model-00007-of-00138.safetensors +3 -0
  12. model-00008-of-00138.safetensors +3 -0
  13. model-00009-of-00138.safetensors +3 -0
  14. model-00010-of-00138.safetensors +3 -0
  15. model-00011-of-00138.safetensors +3 -0
  16. model-00012-of-00138.safetensors +3 -0
  17. model-00013-of-00138.safetensors +3 -0
  18. model-00014-of-00138.safetensors +3 -0
  19. model-00015-of-00138.safetensors +3 -0
  20. model-00016-of-00138.safetensors +3 -0
  21. model-00017-of-00138.safetensors +3 -0
  22. model-00018-of-00138.safetensors +3 -0
  23. model-00019-of-00138.safetensors +3 -0
  24. model-00020-of-00138.safetensors +3 -0
  25. model-00021-of-00138.safetensors +3 -0
  26. model-00022-of-00138.safetensors +3 -0
  27. model-00023-of-00138.safetensors +3 -0
  28. model-00024-of-00138.safetensors +3 -0
  29. model-00025-of-00138.safetensors +3 -0
  30. model-00026-of-00138.safetensors +3 -0
  31. model-00027-of-00138.safetensors +3 -0
  32. model-00028-of-00138.safetensors +3 -0
  33. model-00029-of-00138.safetensors +3 -0
  34. model-00030-of-00138.safetensors +3 -0
  35. model-00031-of-00138.safetensors +3 -0
  36. model-00032-of-00138.safetensors +3 -0
  37. model-00033-of-00138.safetensors +3 -0
  38. model-00034-of-00138.safetensors +3 -0
  39. model-00035-of-00138.safetensors +3 -0
  40. model-00036-of-00138.safetensors +3 -0
  41. model-00037-of-00138.safetensors +3 -0
  42. model-00038-of-00138.safetensors +3 -0
  43. model-00039-of-00138.safetensors +3 -0
  44. model-00040-of-00138.safetensors +3 -0
  45. model-00041-of-00138.safetensors +3 -0
  46. model-00042-of-00138.safetensors +3 -0
  47. model-00043-of-00138.safetensors +3 -0
  48. model-00044-of-00138.safetensors +3 -0
  49. model-00045-of-00138.safetensors +3 -0
  50. model-00046-of-00138.safetensors +3 -0
chat_template.jinja ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if not add_generation_prompt is defined %}
2
+ {%- set add_generation_prompt = false %}
3
+ {%- endif %}
4
+ {%- set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='', is_first_sp=true, is_last_user=false) %}
5
+ {%- for message in messages %}
6
+ {%- if message['role'] == 'system' %}
7
+ {%- if ns.is_first_sp %}
8
+ {%- set ns.system_prompt = ns.system_prompt + message['content'] %}
9
+ {%- set ns.is_first_sp = false %}
10
+ {%- else %}
11
+ {%- set ns.system_prompt = ns.system_prompt + '\n\n' + message['content'] %}
12
+ {%- endif %}
13
+ {%- endif %}
14
+ {%- endfor %}
15
+
16
+ {#- Adapted from https://github.com/sgl-project/sglang/blob/main/examples/chat_template/tool_chat_template_deepseekr1.jinja #}
17
+ {%- if tools is defined and tools is not none %}
18
+ {%- set tool_ns = namespace(text='You are a helpful assistant with tool calling capabilities. ' + 'When a tool call is needed, you MUST use the following format to issue the call:\n' + '<|tool▁calls▁begin|><|tool▁call▁begin|>function<|tool▁sep|>FUNCTION_NAME\n' + '```json\n{"param1": "value1", "param2": "value2"}\n```<|tool▁call▁end|><|tool▁calls▁end|>\n\n' + 'Make sure the JSON is valid.' + '## Tools\n\n### Function\n\nYou have the following functions available:\n\n') %}
19
+ {%- for tool in tools %}
20
+ {%- set tool_ns.text = tool_ns.text + '\n```json\n' + (tool | tojson) + '\n```\n' %}
21
+ {%- endfor %}
22
+ {%- if ns.system_prompt|length != 0 %}
23
+ {%- set ns.system_prompt = ns.system_prompt + '\n\n' + tool_ns.text %}
24
+ {%- else %}
25
+ {%- set ns.system_prompt = tool_ns.text %}
26
+ {%- endif %}
27
+ {%- endif %}
28
+ {{- bos_token }}
29
+ {{- ns.system_prompt }}
30
+ {%- set last_index = (messages|length - 1) %}
31
+ {%- for message in messages %}
32
+ {%- set content = message['content'] %}
33
+ {%- if message['role'] == 'user' %}
34
+ {%- set ns.is_tool = false -%}
35
+ {%- set ns.is_first = false -%}
36
+ {%- set ns.is_last_user = true -%}
37
+ {%- if loop.index0 == last_index %}
38
+ {{- '<|User|>' + content }}
39
+ {%- else %}
40
+ {{- '<|User|>' + content + '<|Assistant|>'}}
41
+ {%- endif %}
42
+ {%- endif %}
43
+ {%- if message['role'] == 'assistant' %}
44
+ {%- if '</think>' in content %}
45
+ {%- set content = (content.split('</think>')|last) %}
46
+ {%- endif %}
47
+ {%- endif %}
48
+ {%- if message['role'] == 'assistant' and message['tool_calls'] is defined and message['tool_calls'] is not none %}
49
+ {%- set ns.is_last_user = false -%}
50
+ {%- if ns.is_tool %}
51
+ {{- '<|tool▁outputs▁end|>'}}
52
+ {%- endif %}
53
+ {%- set ns.is_first = false %}
54
+ {%- set ns.is_tool = false -%}
55
+ {%- set ns.is_output_first = true %}
56
+ {%- for tool in message['tool_calls'] %}
57
+ {%- set arguments = tool['function']['arguments'] %}
58
+ {%- if arguments is not string %}
59
+ {%- set arguments = arguments|tojson %}
60
+ {%- endif %}
61
+ {%- if not ns.is_first %}
62
+ {%- if content is none %}
63
+ {{- '<|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + arguments + '\n' + '```' + '<|tool▁call▁end|>'}}
64
+ }
65
+ {%- else %}
66
+ {{- content + '<|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + arguments + '\n' + '```' + '<|tool▁call▁end|>'}}
67
+ {%- endif %}
68
+ {%- set ns.is_first = true -%}
69
+ {%- else %}
70
+ {{- '\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\n' + '```json' + '\n' + arguments + '\n' + '```' + '<|tool▁call▁end|>'}}
71
+ {%- endif %}
72
+ {%- endfor %}
73
+ {{- '<|tool▁calls▁end|><|end▁of▁sentence|>'}}
74
+ {%- endif %}
75
+ {%- if message['role'] == 'assistant' and (message['tool_calls'] is not defined or message['tool_calls'] is none) %}
76
+ {%- set ns.is_last_user = false -%}
77
+ {%- if ns.is_tool %}
78
+ {{- '<|tool▁outputs▁end|>' + content + '<|end▁of▁sentence|>'}}
79
+ {%- set ns.is_tool = false -%}
80
+ {%- else %}
81
+ {{- content + '<|end▁of▁sentence|>'}}
82
+ {%- endif %}
83
+ {%- endif %}
84
+ {%- if message['role'] == 'tool' %}
85
+ {%- set ns.is_last_user = false -%}
86
+ {%- set ns.is_tool = true -%}
87
+ {%- if ns.is_output_first %}
88
+ {{- '<|tool▁outputs▁begin|><|tool▁output▁begin|>' + content + '<|tool▁output▁end|>'}}
89
+ {%- set ns.is_output_first = false %}
90
+ {%- else %}
91
+ {{- '\n<|tool▁output▁begin|>' + content + '<|tool▁output▁end|>'}}
92
+ {%- endif %}
93
+ {%- endif %}
94
+ {%- endfor -%}
95
+ {%- if ns.is_tool %}
96
+ {{- '<|tool▁outputs▁end|>'}}
97
+ {%- endif %}
98
+ {#- if add_generation_prompt and not ns.is_last_user and not ns.is_tool #}
99
+ {%- if add_generation_prompt and not ns.is_tool %}
100
+ {{- '<|Assistant|>'}}
101
+ {%- endif %}
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
+ "bos_token_id": 0,
13
+ "dtype": "bfloat16",
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": 2,
36
+ "q_lora_rank": 1536,
37
+ "qk_nope_head_dim": 128,
38
+ "qk_rope_head_dim": 64,
39
+ "quantization_config": {
40
+ "algo_config": null,
41
+ "exclude": [
42
+ "model.layers.61.eh_proj",
43
+ "model.layers.61.shared_head.head",
44
+ "lm_head"
45
+ ],
46
+ "export": {
47
+ "kv_cache_group": [],
48
+ "min_kv_scale": 0.0,
49
+ "pack_method": "reorder",
50
+ "weight_format": "real_quantized",
51
+ "weight_merge_groups": null
52
+ },
53
+ "global_quant_config": {
54
+ "bias": null,
55
+ "input_tensors": {
56
+ "ch_axis": 1,
57
+ "dtype": "fp8_e4m3",
58
+ "group_size": null,
59
+ "is_dynamic": true,
60
+ "is_scale_quant": false,
61
+ "mx_element_dtype": null,
62
+ "observer_cls": "PerChannelMinMaxObserver",
63
+ "qscheme": "per_channel",
64
+ "round_method": "half_even",
65
+ "scale_calculation_mode": null,
66
+ "scale_format": null,
67
+ "scale_type": "float",
68
+ "symmetric": true
69
+ },
70
+ "output_tensors": null,
71
+ "target_device": null,
72
+ "weight": {
73
+ "ch_axis": 0,
74
+ "dtype": "fp8_e4m3",
75
+ "group_size": null,
76
+ "is_dynamic": false,
77
+ "is_scale_quant": false,
78
+ "mx_element_dtype": null,
79
+ "observer_cls": "PerChannelMinMaxObserver",
80
+ "qscheme": "per_channel",
81
+ "round_method": "half_even",
82
+ "scale_calculation_mode": null,
83
+ "scale_format": null,
84
+ "scale_type": "float",
85
+ "symmetric": true
86
+ }
87
+ },
88
+ "kv_cache_post_rope": false,
89
+ "kv_cache_quant_config": {},
90
+ "layer_quant_config": {},
91
+ "layer_type_quant_config": {},
92
+ "quant_method": "quark",
93
+ "quant_mode": "eager_mode",
94
+ "softmax_quant_spec": null,
95
+ "version": "0.11+05471d7d04"
96
+ },
97
+ "rms_norm_eps": 1e-06,
98
+ "rope_scaling": {
99
+ "beta_fast": 32,
100
+ "beta_slow": 1,
101
+ "factor": 40,
102
+ "mscale": 1.0,
103
+ "mscale_all_dim": 1.0,
104
+ "original_max_position_embeddings": 4096,
105
+ "type": "yarn"
106
+ },
107
+ "rope_theta": 10000,
108
+ "routed_scaling_factor": 2.5,
109
+ "scoring_func": "sigmoid",
110
+ "tie_word_embeddings": false,
111
+ "topk_group": 4,
112
+ "topk_method": "noaux_tc",
113
+ "transformers_version": "4.57.1",
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,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ tie_word_embeddings (`bool`, *optional*, defaults to `False`):
86
+ Whether to tie weight embeddings
87
+ rope_theta (`float`, *optional*, defaults to 10000.0):
88
+ The base period of the RoPE embeddings.
89
+ rope_scaling (`Dict`, *optional*):
90
+ Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
91
+ strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
92
+ `{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
93
+ `max_position_embeddings` to the expected new maximum.
94
+ attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
95
+ Whether to use a bias in the query, key, value and output projection layers during self-attention.
96
+ attention_dropout (`float`, *optional*, defaults to 0.0):
97
+ The dropout ratio for the attention probabilities.
98
+
99
+ ```python
100
+ >>> from transformers import DeepseekV3Model, DeepseekV3Config
101
+
102
+ >>> # Initializing a Deepseek-V3 style configuration
103
+ >>> configuration = DeepseekV3Config()
104
+
105
+ >>> # Accessing the model configuration
106
+ >>> configuration = model.config
107
+ ```"""
108
+
109
+ model_type = "deepseek_v3"
110
+ keys_to_ignore_at_inference = ["past_key_values"]
111
+
112
+ def __init__(
113
+ self,
114
+ vocab_size=129280,
115
+ hidden_size=7168,
116
+ intermediate_size=18432,
117
+ moe_intermediate_size = 2048,
118
+ num_hidden_layers=61,
119
+ num_nextn_predict_layers=1,
120
+ num_attention_heads=128,
121
+ num_key_value_heads=128,
122
+ n_shared_experts = 1,
123
+ n_routed_experts = 256,
124
+ ep_size = 1,
125
+ routed_scaling_factor = 2.5,
126
+ kv_lora_rank = 512,
127
+ q_lora_rank = 1536,
128
+ qk_rope_head_dim = 64,
129
+ v_head_dim = 128,
130
+ qk_nope_head_dim = 128,
131
+ topk_method = 'noaux_tc',
132
+ n_group = 8,
133
+ topk_group = 4,
134
+ num_experts_per_tok = 8,
135
+ moe_layer_freq = 1,
136
+ first_k_dense_replace = 3,
137
+ norm_topk_prob = True,
138
+ scoring_func = 'sigmoid',
139
+ hidden_act="silu",
140
+ max_position_embeddings=4096,
141
+ initializer_range=0.02,
142
+ rms_norm_eps=1e-6,
143
+ use_cache=True,
144
+ pad_token_id=None,
145
+ bos_token_id=0,
146
+ eos_token_id=1,
147
+ tie_word_embeddings=False,
148
+ rope_theta=10000.0,
149
+ rope_scaling=None,
150
+ attention_bias=False,
151
+ attention_dropout=0.0,
152
+ **kwargs,
153
+ ):
154
+ self.vocab_size = vocab_size
155
+ self.max_position_embeddings = max_position_embeddings
156
+ self.hidden_size = hidden_size
157
+ self.intermediate_size = intermediate_size
158
+ self.moe_intermediate_size = moe_intermediate_size
159
+ self.num_hidden_layers = num_hidden_layers
160
+ self.num_nextn_predict_layers = num_nextn_predict_layers
161
+ self.num_attention_heads = num_attention_heads
162
+ self.n_shared_experts = n_shared_experts
163
+ self.n_routed_experts = n_routed_experts
164
+ self.ep_size = ep_size
165
+ self.routed_scaling_factor = routed_scaling_factor
166
+ self.kv_lora_rank = kv_lora_rank
167
+ self.q_lora_rank = q_lora_rank
168
+ self.qk_rope_head_dim = qk_rope_head_dim
169
+ self.v_head_dim = v_head_dim
170
+ self.qk_nope_head_dim = qk_nope_head_dim
171
+ self.topk_method = topk_method
172
+ self.n_group = n_group
173
+ self.topk_group = topk_group
174
+ self.num_experts_per_tok = num_experts_per_tok
175
+ self.moe_layer_freq = moe_layer_freq
176
+ self.first_k_dense_replace = first_k_dense_replace
177
+ self.norm_topk_prob = norm_topk_prob
178
+ self.scoring_func = scoring_func
179
+ # for backward compatibility
180
+ if num_key_value_heads is None:
181
+ num_key_value_heads = num_attention_heads
182
+
183
+ self.num_key_value_heads = num_key_value_heads
184
+ self.hidden_act = hidden_act
185
+ self.initializer_range = initializer_range
186
+ self.rms_norm_eps = rms_norm_eps
187
+ self.use_cache = use_cache
188
+ self.rope_theta = rope_theta
189
+ self.rope_scaling = rope_scaling
190
+ self.attention_bias = attention_bias
191
+ self.attention_dropout = attention_dropout
192
+
193
+ super().__init__(
194
+ pad_token_id=pad_token_id,
195
+ bos_token_id=bos_token_id,
196
+ eos_token_id=eos_token_id,
197
+ tie_word_embeddings=tie_word_embeddings,
198
+ **kwargs,
199
+ )
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.57.1"
9
+ }
model-00001-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a698e56b6c54393dcb6637c9b217b22140e999ecf5c58fb8050d7175d0aeaf38
3
+ size 4996171024
model-00002-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:798817233ff326fd1d029afefc1381592c5540c65e8929fd51eb219131159a6e
3
+ size 4993855224
model-00003-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e9e0036fc95c3f4f5a59e3f77ef86a6539d8efe6b0b14593885c2216af6b22c
3
+ size 4993865912
model-00004-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4b7a2df771d4756357ae5330c66143dd97eaddfdcba318f1b8255946a73514f
3
+ size 4993860696
model-00005-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8986e887927f6aaf5f8a999d523028955329448965996e032bc5e3e621484c47
3
+ size 4993855672
model-00006-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec1b721fd551fbf97567ff7b03d27962500dfe87a49562d973355bab8970cb70
3
+ size 4993860648
model-00007-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6c041802e30da2465a2be6c6ca21cb2304a5d2fc5d39181f609e295f8c6fb5d
3
+ size 4993855496
model-00008-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41cce94a5380f722c071cf388be6cf62ad4d9a53c1e446ca6df7b90dcb4daddc
3
+ size 4993860824
model-00009-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ae029884dd4f1234a756fc808583730e0a7f35464b139e4c8e52cc735538c78
3
+ size 4993865528
model-00010-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:557c1f380105f6166c8cc44ee4de40cb21b107037e597d5481629a59f39bd245
3
+ size 4993861080
model-00011-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70ef28136dab8400dd7b67b6f58cdab7fa69107c5e0548cb96da3351cdb72fe6
3
+ size 4993855032
model-00012-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00eeff1fb8dfdb6ff2e61c8009136ad97479f018629c0bb879d0c0b4c9bc62af
3
+ size 4993855672
model-00013-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2f6f60be221491125d5a93dfbc4d4d13c21d2144342ced73c57e33c6f237042f
3
+ size 4993860648
model-00014-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6bd4579efc61f33eb3148a9b2a4904a1e5b5c0854439e67c203827cf09d92613
3
+ size 4993865792
model-00015-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb52fdc1f28401c2696d790f22e72ca126722fec3ad0674a67478e9ae20f3c08
3
+ size 4993860768
model-00016-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44abc5c1f65b17e35df1a0879ce62ea9f4b767a2417b40d4bc6341b660c26338
3
+ size 4993855344
model-00017-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f63522254c845c7afd0254fad26c2efd0acb2275afa560fbef7d625d5c60fe1f
3
+ size 4993861088
model-00018-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2efc3f967808af592e01f254609e4f40dac6d8910e512ee801f633be7f98c24
3
+ size 4993855808
model-00019-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e55345d1e656e6e6c1cc57ef7f86c581c298ee7096e4e2cb194cafbc59fbf16a
3
+ size 4993866592
model-00020-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0e78a1744aa43248f248f9ef5ce5ed5d80b33e28295548f7f44118fe9d5f5c9
3
+ size 4993861320
model-00021-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79acb79697be84bdb3842ebe69f5942247343aa1c6a06c19417bad70ce772477
3
+ size 4993856288
model-00022-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09116973655ce6478d6910e444f11c0522d5a4dcfbca90182af48d5ad9f98bae
3
+ size 4993861376
model-00023-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb7bf2459297354260b7d7c339cd912b76a6340d938e4b2e3f7db836c07fc036
3
+ size 4993856080
model-00024-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ba6126ccbdacc119d8222271ced033172024cebcef6af3c6da8359a8fe52476
3
+ size 4993861584
model-00025-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0cd59e9be859f37ad9e93f015bed8e110028710e32822824598e1f1479b98a8
3
+ size 4993866112
model-00026-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69ad2be32ad94fee963081f57fa7a76aaa7c4a634689c66d8d543cb42b0ba82c
3
+ size 4993856352
model-00027-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f96cb296b5a127fdc65f9acc85a9abf09289a97913d9688b3ea3befcfcbe49a7
3
+ size 4993861320
model-00028-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28dbb0054575f9c5a45bd38f37c688d6cf60323178adb5b5f866e4f517d61362
3
+ size 4993856344
model-00029-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e405c2c32bd12724ed422192356b60daf4a3b16e452223fd4e5f960aefc0035
3
+ size 4993861320
model-00030-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc37b9ae599e80285d2f64758c243e1cdb01a1a9cfb01ec5fd09734a7f9e360a
3
+ size 4993866376
model-00031-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6b78412d81290733875ea104ccb07db12fb20228daba5f2c939a520ecef04f3
3
+ size 4993861528
model-00032-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:547a970fd0940f6f1334ced3418f93fa3438c35f364437fd1d9935453239dc78
3
+ size 4993855928
model-00033-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e96f7e5a8924f690f39bdcc1e5888bdeb6409daeacf38348393f0e5d776adab
3
+ size 4997527104
model-00034-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca91cfe6e0c9eb97c47ddc900bb121b49237ba6f28fad4033224b1adb6e3737e
3
+ size 4990190360
model-00035-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1a559be95b623e39f7e23448c7b41bf95751a96a8899506e214f3c9c1a1591a
3
+ size 4993866592
model-00036-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46bfa5d9b81bf848d8cdc01ee77e46e0949d7b516df8c2a2f86aeb632ee622c5
3
+ size 4993861320
model-00037-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64999974451a64df1765f40e687b8a5dbcfe39a8fffe33d0002bf9642edbe96a
3
+ size 4993856192
model-00038-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee33814479be4499632d4e0e6f81e68205ec732e64260e9c9fa2c747a4d72135
3
+ size 4993861472
model-00039-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9bfd8032ec390a727f43cf2149ce8f267282eaa93c75b874ab67f7f890b31ed
3
+ size 4993855984
model-00040-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0630768da9d68f63842677d9c59b10c89216b68d42c24c624d3a69d8e34c4d73
3
+ size 4993861712
model-00041-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54ab699a9cb2ca1c2b83efa24d4fc59f7a6d4094cb4d2ca7c5f6d2476ef40546
3
+ size 4993865984
model-00042-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df5ef68096df84044a8c3a67c630765aff525bde064420c35a0c1401b62b05a9
3
+ size 4993856352
model-00043-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22da59a5235bff7eda0f42f20a9e0589e2b94936728ec0dd9cc05c83e0e7b971
3
+ size 4993861320
model-00044-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62dc3523e619ffbd0b2bde10d1756a16337ac9fe12d7cde9dd5aabec19c121f3
3
+ size 4993856248
model-00045-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e25aee6e1da43902bff54eeeb8d6149e8648f4342790626d81d93162e8839ad5
3
+ size 4993861416
model-00046-of-00138.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:acbf3abd6350673231094d314d63766ee0f9a5a386aea25f2f6a42d71dc82185
3
+ size 4993866280