Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +34 -0
- config.json +69 -0
- configuration_deepseek.py +210 -0
- model-00001-of-00088.safetensors +3 -0
- model-00002-of-00088.safetensors +3 -0
- model-00003-of-00088.safetensors +3 -0
- model-00004-of-00088.safetensors +3 -0
- model-00005-of-00088.safetensors +3 -0
- model-00006-of-00088.safetensors +3 -0
- model-00007-of-00088.safetensors +3 -0
- model-00008-of-00088.safetensors +3 -0
- model-00009-of-00088.safetensors +3 -0
- model-00010-of-00088.safetensors +3 -0
- model-00011-of-00088.safetensors +3 -0
- model-00012-of-00088.safetensors +3 -0
- model-00013-of-00088.safetensors +3 -0
- model-00014-of-00088.safetensors +3 -0
- model-00015-of-00088.safetensors +3 -0
- model-00016-of-00088.safetensors +3 -0
- model-00017-of-00088.safetensors +3 -0
- model-00018-of-00088.safetensors +3 -0
- model-00019-of-00088.safetensors +3 -0
- model-00020-of-00088.safetensors +3 -0
- model-00021-of-00088.safetensors +3 -0
- model-00022-of-00088.safetensors +3 -0
- model-00023-of-00088.safetensors +3 -0
- model-00024-of-00088.safetensors +3 -0
- model-00025-of-00088.safetensors +3 -0
- model-00026-of-00088.safetensors +3 -0
- model-00027-of-00088.safetensors +3 -0
- model-00028-of-00088.safetensors +3 -0
- model-00029-of-00088.safetensors +3 -0
- model-00030-of-00088.safetensors +3 -0
- model-00031-of-00088.safetensors +3 -0
- model-00032-of-00088.safetensors +3 -0
- model-00033-of-00088.safetensors +3 -0
- model-00034-of-00088.safetensors +3 -0
- model-00035-of-00088.safetensors +3 -0
- model-00036-of-00088.safetensors +3 -0
- model-00037-of-00088.safetensors +3 -0
- model-00038-of-00088.safetensors +3 -0
- model-00039-of-00088.safetensors +3 -0
- model-00040-of-00088.safetensors +3 -0
- model-00041-of-00088.safetensors +3 -0
- model-00042-of-00088.safetensors +3 -0
- model-00043-of-00088.safetensors +3 -0
- model-00044-of-00088.safetensors +3 -0
- model-00045-of-00088.safetensors +3 -0
- model-00046-of-00088.safetensors +3 -0
- model-00047-of-00088.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
base_model: perplexity-ai/r1-1776
|
| 4 |
+
tags:
|
| 5 |
+
- mlx
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
# mlx-community/perplexity-ai-r1-1776-4bit
|
| 9 |
+
|
| 10 |
+
The Model [mlx-community/perplexity-ai-r1-1776-4bit](https://huggingface.co/mlx-community/perplexity-ai-r1-1776-4bit) was
|
| 11 |
+
converted to MLX format from [perplexity-ai/r1-1776](https://huggingface.co/perplexity-ai/r1-1776)
|
| 12 |
+
using mlx-lm version **0.21.4**.
|
| 13 |
+
|
| 14 |
+
## Use with mlx
|
| 15 |
+
|
| 16 |
+
```bash
|
| 17 |
+
pip install mlx-lm
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
```python
|
| 21 |
+
from mlx_lm import load, generate
|
| 22 |
+
|
| 23 |
+
model, tokenizer = load("mlx-community/perplexity-ai-r1-1776-4bit")
|
| 24 |
+
|
| 25 |
+
prompt = "hello"
|
| 26 |
+
|
| 27 |
+
if tokenizer.chat_template is not None:
|
| 28 |
+
messages = [{"role": "user", "content": prompt}]
|
| 29 |
+
prompt = tokenizer.apply_chat_template(
|
| 30 |
+
messages, add_generation_prompt=True
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
| 34 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"DeepseekV3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_deepseek.DeepseekV3Config",
|
| 9 |
+
"AutoModel": "modeling_deepseek.DeepseekV3Model",
|
| 10 |
+
"AutoModelForCausalLM": "modeling_deepseek.DeepseekV3ForCausalLM"
|
| 11 |
+
},
|
| 12 |
+
"aux_loss_alpha": 0.001,
|
| 13 |
+
"bos_token_id": 0,
|
| 14 |
+
"eos_token_id": 1,
|
| 15 |
+
"ep_size": 1,
|
| 16 |
+
"first_k_dense_replace": 3,
|
| 17 |
+
"hidden_act": "silu",
|
| 18 |
+
"hidden_size": 7168,
|
| 19 |
+
"initializer_range": 0.02,
|
| 20 |
+
"intermediate_size": 18432,
|
| 21 |
+
"kv_lora_rank": 512,
|
| 22 |
+
"max_position_embeddings": 163840,
|
| 23 |
+
"model_type": "deepseek_v3",
|
| 24 |
+
"moe_intermediate_size": 2048,
|
| 25 |
+
"moe_layer_freq": 1,
|
| 26 |
+
"n_group": 8,
|
| 27 |
+
"n_routed_experts": 256,
|
| 28 |
+
"n_shared_experts": 1,
|
| 29 |
+
"norm_topk_prob": true,
|
| 30 |
+
"num_attention_heads": 128,
|
| 31 |
+
"num_experts_per_tok": 8,
|
| 32 |
+
"num_hidden_layers": 61,
|
| 33 |
+
"num_key_value_heads": 128,
|
| 34 |
+
"num_nextn_predict_layers": 1,
|
| 35 |
+
"pretraining_tp": 1,
|
| 36 |
+
"q_lora_rank": 1536,
|
| 37 |
+
"qk_nope_head_dim": 128,
|
| 38 |
+
"qk_rope_head_dim": 64,
|
| 39 |
+
"quantization": {
|
| 40 |
+
"group_size": 64,
|
| 41 |
+
"bits": 4
|
| 42 |
+
},
|
| 43 |
+
"quantization_config": {
|
| 44 |
+
"group_size": 64,
|
| 45 |
+
"bits": 4
|
| 46 |
+
},
|
| 47 |
+
"rms_norm_eps": 1e-06,
|
| 48 |
+
"rope_scaling": {
|
| 49 |
+
"beta_fast": 32,
|
| 50 |
+
"beta_slow": 1,
|
| 51 |
+
"factor": 40,
|
| 52 |
+
"mscale": 1,
|
| 53 |
+
"mscale_all_dim": 1,
|
| 54 |
+
"original_max_position_embeddings": 4096,
|
| 55 |
+
"type": "yarn"
|
| 56 |
+
},
|
| 57 |
+
"rope_theta": 10000,
|
| 58 |
+
"routed_scaling_factor": 2.5,
|
| 59 |
+
"scoring_func": "sigmoid",
|
| 60 |
+
"seq_aux": true,
|
| 61 |
+
"tie_word_embeddings": false,
|
| 62 |
+
"topk_group": 4,
|
| 63 |
+
"topk_method": "noaux_tc",
|
| 64 |
+
"torch_dtype": "bfloat16",
|
| 65 |
+
"transformers_version": "4.46.3",
|
| 66 |
+
"use_cache": true,
|
| 67 |
+
"v_head_dim": 128,
|
| 68 |
+
"vocab_size": 129280
|
| 69 |
+
}
|
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 |
+
)
|
model-00001-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0e639229d1b6326969e23508ec74894438307124b1464da91d534b92fa349fea
|
| 3 |
+
size 3725148265
|
model-00002-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d1d9d3951da924734c88db61cab916d0b188ec0a9149af08ecb6178ef40dca76
|
| 3 |
+
size 4361585379
|
model-00003-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:58af6d9c927c6c4cd3ac4111b1f9bbe2f34e3ee998cbd14a9d560b0fe5d3adf5
|
| 3 |
+
size 4227859218
|
model-00004-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:682b62320a83b9ec3b013503d24a09454d7af069d3ab443984973c954b007493
|
| 3 |
+
size 4361585451
|
model-00005-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ebd41bd51a7ca077abc20b4b57fbcba43f961525d010a079754fe9e2b16d4751
|
| 3 |
+
size 4361585389
|
model-00006-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e71ce6f760e6358c753fd674f5848cdad05f2588df91e97d3aafcf587af94bd9
|
| 3 |
+
size 4227859214
|
model-00007-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bda61469f2f211a06471ed0fff61b2a741bce2e4749c25dd75950ad07cf57978
|
| 3 |
+
size 4361585449
|
model-00008-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f6d23350721bf31935f6fae692ed2b6a230ebe7f1a511a8361c120a63f7882b0
|
| 3 |
+
size 4361585357
|
model-00009-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a897fca735014fc39a05033831f428d6d325ab0e6aa66e7d7b79777db0a8da5b
|
| 3 |
+
size 4227859218
|
model-00010-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a454b1548858ec12d542d1ba3363d10b5998bde6d43cf1dee9a834072e3cdb2
|
| 3 |
+
size 4361585375
|
model-00011-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6dc2a8a8fcb40415decee1ca63477741b541a8da06f2da7b3687f4ba75424178
|
| 3 |
+
size 4361585378
|
model-00012-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:53b6cc3f701becbc26411c0cf106d19f9a4320b8223efee55fb35b900f2f9c4a
|
| 3 |
+
size 4227859224
|
model-00013-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:994fa413538d333166585af5c4895b4dca40997399f682b1576b189714ab43eb
|
| 3 |
+
size 4361585461
|
model-00014-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5ef54d46f9ce3ecbb1079203f784c4fe1a15c0e6b81842ec31e980544abe118d
|
| 3 |
+
size 4361585391
|
model-00015-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9444b6888ff98d285db4a9b8fa220e3195f071c0e04b54a4d4aa9305808b4aeb
|
| 3 |
+
size 4227859224
|
model-00016-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:125333db5564bb1c428792e8b4983397a94e02d6ff188530783fcdfc3e4bb13c
|
| 3 |
+
size 4361585455
|
model-00017-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dae3be5eaa43a10971f7a513071943ba2b4eb97ab9b9149809ff44e342a9b3de
|
| 3 |
+
size 4361585389
|
model-00018-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f022d9143e523cdc053097758e9681222b8947d42b1b56714bf47b3a1e2f28d1
|
| 3 |
+
size 4227859220
|
model-00019-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d12944cd71da28faf6a6ed48e23feca9d4852290210d52e5922c0c96fae8bea
|
| 3 |
+
size 4361585463
|
model-00020-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8a90594e220af850716a6b68720dff03912189b158ed9f99997ade77f21491c0
|
| 3 |
+
size 4361585423
|
model-00021-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d22f259ff92722c7261f536cd8a09209d15d3f17f6aa1eeaab59b63e4f2f517f
|
| 3 |
+
size 4227859224
|
model-00022-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:085788266a9b98e950e0b1205c6c5b6508c1bbf7e62ec86630fc9a4bc5e19b27
|
| 3 |
+
size 4361585441
|
model-00023-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a2d07cb7fa9d47d4a45f840231116873f836d321e883dd027b9d13ae93183fa9
|
| 3 |
+
size 4361585399
|
model-00024-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9fe8e48763ccbe3dde8d90ba3418e09015524f07029805b70def70f6e92131cf
|
| 3 |
+
size 4227859226
|
model-00025-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f6eef7d3b164272fd8cac3ebe5f6b65931b3aeecec775998b36c78e728727289
|
| 3 |
+
size 4361585485
|
model-00026-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3f831530ddcd057ab5065a1e21a631688052835b92c6f49a98aadb77de51869d
|
| 3 |
+
size 4361585403
|
model-00027-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:75f55489f72bc1624eb80c8a8118a298ff44071ea60d394a6ecea996ba3ec997
|
| 3 |
+
size 4227859220
|
model-00028-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:658eb03606209b77f7a4aecf9eb0f5ecabb547b4c41119a56e0911642f526302
|
| 3 |
+
size 4361585453
|
model-00029-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:91735a364a3209acfe7c0ebcde2bff6d48ab0e3f205e7a6033a19f03dd1170e3
|
| 3 |
+
size 4361585371
|
model-00030-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d15075e8af6989ec6d5e69b2329ac18da47b71fbe1000e81c45c73dcccd16b4a
|
| 3 |
+
size 4227859222
|
model-00031-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96ed4a0e523de336e3d9f15101ea7b4260690bb22cc7d2063abb8bc3e331e064
|
| 3 |
+
size 4361585487
|
model-00032-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81d0c2639dd988f87ee532535765f4e1bfbf8a21975fad6497e926919bf0b80f
|
| 3 |
+
size 4361585433
|
model-00033-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e3fc7f3cbb8dcf5df674d9c9ac98acd732c19896b1df03215d484af8bc056cc3
|
| 3 |
+
size 4227859218
|
model-00034-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6027c64069e5190aa41e11627bdb0a72a5a272e4cf7d641800a7b04a558efac0
|
| 3 |
+
size 4361585441
|
model-00035-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fcbdcf03f1e918a1d84a65cb10d92c3f8338d43e2397b1913fc0aface99f6f1b
|
| 3 |
+
size 4361585411
|
model-00036-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:99dba7a707912b50afd4af3d1025d1d40424bc7aaa39677a985688b5bfcd62f8
|
| 3 |
+
size 4227859224
|
model-00037-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad22deea3e560c7d9532e6b2c5377b33b1d44cebee10079368786f898c107af1
|
| 3 |
+
size 4361585487
|
model-00038-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:39a9eb8010a09f05add02fb0f2068c59c47fcf9d3f0f36422680cf641b2e5e06
|
| 3 |
+
size 4361585399
|
model-00039-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:28e134db431f9d807121efdd221d803c58e4ee50053f28ab7efdb7c73af74c5e
|
| 3 |
+
size 4227859220
|
model-00040-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ba5b8df0ad5b16bac8ed2879467f138129d35c5a080b1f0b540afe87131834d7
|
| 3 |
+
size 4361585427
|
model-00041-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:85886a431f6897c363a7b1b7fecc481e3e74cc616838ee8951367d703b3b3e5b
|
| 3 |
+
size 4361585389
|
model-00042-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a67f008d5c552e65c7ff92fde2a108ea705da648ccee13aacfab54755e6dcbdf
|
| 3 |
+
size 4227859224
|
model-00043-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:05c5d3ce8bee94905cf22130203376fbcf272ae20c3893b0230671686849c235
|
| 3 |
+
size 4361585485
|
model-00044-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3ca58e249a28a09dd47b59b11bc487578ae41abaaad1ea325a4602b53212263c
|
| 3 |
+
size 4361585425
|
model-00045-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b8c2f3661644687257b2398001540a5875e267fadb831e9f684c48e56bbe9370
|
| 3 |
+
size 4227859224
|
model-00046-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:25d93b78ba54e57def62c45d80cfd53c1364f4d180e838c17c03a2ead1b259e3
|
| 3 |
+
size 4361585485
|
model-00047-of-00088.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8391ba9b4a021378a44a5d2d44c48291d3a5b402c7b907d0223ddf851997caf7
|
| 3 |
+
size 4361585385
|