Upload MLX converted model with quantization settings
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +41 -0
- chat_template.jinja +46 -0
- config.json +0 -0
- configuration_deepseek.py +212 -0
- generation_config.json +4 -0
- model-00001-of-00090.safetensors +3 -0
- model-00002-of-00090.safetensors +3 -0
- model-00003-of-00090.safetensors +3 -0
- model-00004-of-00090.safetensors +3 -0
- model-00005-of-00090.safetensors +3 -0
- model-00006-of-00090.safetensors +3 -0
- model-00007-of-00090.safetensors +3 -0
- model-00008-of-00090.safetensors +3 -0
- model-00009-of-00090.safetensors +3 -0
- model-00010-of-00090.safetensors +3 -0
- model-00011-of-00090.safetensors +3 -0
- model-00012-of-00090.safetensors +3 -0
- model-00013-of-00090.safetensors +3 -0
- model-00014-of-00090.safetensors +3 -0
- model-00015-of-00090.safetensors +3 -0
- model-00016-of-00090.safetensors +3 -0
- model-00017-of-00090.safetensors +3 -0
- model-00018-of-00090.safetensors +3 -0
- model-00019-of-00090.safetensors +3 -0
- model-00020-of-00090.safetensors +3 -0
- model-00021-of-00090.safetensors +3 -0
- model-00022-of-00090.safetensors +3 -0
- model-00023-of-00090.safetensors +3 -0
- model-00024-of-00090.safetensors +3 -0
- model-00025-of-00090.safetensors +3 -0
- model-00026-of-00090.safetensors +3 -0
- model-00027-of-00090.safetensors +3 -0
- model-00028-of-00090.safetensors +3 -0
- model-00029-of-00090.safetensors +3 -0
- model-00030-of-00090.safetensors +3 -0
- model-00031-of-00090.safetensors +3 -0
- model-00032-of-00090.safetensors +3 -0
- model-00033-of-00090.safetensors +3 -0
- model-00034-of-00090.safetensors +3 -0
- model-00035-of-00090.safetensors +3 -0
- model-00036-of-00090.safetensors +3 -0
- model-00037-of-00090.safetensors +3 -0
- model-00038-of-00090.safetensors +3 -0
- model-00039-of-00090.safetensors +3 -0
- model-00040-of-00090.safetensors +3 -0
- model-00041-of-00090.safetensors +3 -0
- model-00042-of-00090.safetensors +3 -0
- model-00043-of-00090.safetensors +3 -0
- model-00044-of-00090.safetensors +3 -0
- model-00045-of-00090.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: modified-mit
|
| 4 |
+
library_name: transformers
|
| 5 |
+
base_model: moonshotai/Kimi-K2-Instruct-0905
|
| 6 |
+
tags:
|
| 7 |
+
- mlx
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# cs2764/Kimi-K2-Instruct-0905-mlx-mixed_2_6
|
| 11 |
+
|
| 12 |
+
The Model [cs2764/Kimi-K2-Instruct-0905-mlx-mixed_2_6](https://huggingface.co/cs2764/Kimi-K2-Instruct-0905-mlx-mixed_2_6) was converted to MLX format from [moonshotai/Kimi-K2-Instruct-0905](https://huggingface.co/moonshotai/Kimi-K2-Instruct-0905) using mlx-lm version **0.28.0**.
|
| 13 |
+
|
| 14 |
+
## Quantization Details
|
| 15 |
+
|
| 16 |
+
This model was converted with the following quantization settings:
|
| 17 |
+
|
| 18 |
+
- **Quantization Strategy**: mixed_2_6 (Mixed precision)
|
| 19 |
+
- **Average bits per weight**: 3.146
|
| 20 |
+
|
| 21 |
+
## Use with mlx
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
pip install mlx-lm
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
from mlx_lm import load, generate
|
| 29 |
+
|
| 30 |
+
model, tokenizer = load("cs2764/Kimi-K2-Instruct-0905-mlx-mixed_2_6")
|
| 31 |
+
|
| 32 |
+
prompt="hello"
|
| 33 |
+
|
| 34 |
+
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
|
| 35 |
+
messages = [{"role": "user", "content": prompt}]
|
| 36 |
+
prompt = tokenizer.apply_chat_template(
|
| 37 |
+
messages, tokenize=False, add_generation_prompt=True
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
| 41 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools -%}
|
| 2 |
+
<|im_system|>tool_declare<|im_middle|>
|
| 3 |
+
# Tools
|
| 4 |
+
{{ tools | tojson }}<|im_end|>
|
| 5 |
+
{%- endif -%}
|
| 6 |
+
{%- for message in messages -%}
|
| 7 |
+
{%- if loop.first and messages[0]['role'] != 'system' -%}
|
| 8 |
+
<|im_system|>system<|im_middle|>You are Kimi, an AI assistant created by Moonshot AI.<|im_end|>
|
| 9 |
+
{%- endif -%}
|
| 10 |
+
|
| 11 |
+
{%- set role_name = message.get('name') or message['role'] -%}
|
| 12 |
+
{%- if message['role'] == 'user' -%}
|
| 13 |
+
<|im_user|>{{role_name}}<|im_middle|>
|
| 14 |
+
{%- elif message['role'] == 'assistant' -%}
|
| 15 |
+
<|im_assistant|>{{role_name}}<|im_middle|>
|
| 16 |
+
{%- else -%}
|
| 17 |
+
<|im_system|>{{role_name}}<|im_middle|>
|
| 18 |
+
{% endif %}
|
| 19 |
+
|
| 20 |
+
{%- if message['role'] == 'assistant' and message.get('tool_calls') -%}
|
| 21 |
+
{%- if message['content'] -%}{{ message['content'] }}{%- endif -%}
|
| 22 |
+
<|tool_calls_section_begin|>
|
| 23 |
+
{%- for tool_call in message['tool_calls'] -%}
|
| 24 |
+
{%- set formatted_id = tool_call['id'] -%}
|
| 25 |
+
<|tool_call_begin|>{{ formatted_id }}<|tool_call_argument_begin|>{% if tool_call['function']['arguments'] is string %}{{ tool_call['function']['arguments'] }}{% else %}{{ tool_call['function']['arguments'] | tojson }}{% endif %}<|tool_call_end|>
|
| 26 |
+
{%- endfor -%}
|
| 27 |
+
<|tool_calls_section_end|>
|
| 28 |
+
{%- elif message['role'] == 'tool' -%}
|
| 29 |
+
## Return of {{ message.tool_call_id }}
|
| 30 |
+
{{ message['content'] }}
|
| 31 |
+
{%- elif message['content'] is string -%}
|
| 32 |
+
{{ message['content'] }}
|
| 33 |
+
{%- elif message['content'] is not none -%}
|
| 34 |
+
{% for content in message['content'] -%}
|
| 35 |
+
{% if content['type'] == 'image' or 'image' in content or 'image_url' in content -%}
|
| 36 |
+
<|media_start|>image<|media_content|><|media_pad|><|media_end|>
|
| 37 |
+
{% else -%}
|
| 38 |
+
{{ content['text'] }}
|
| 39 |
+
{%- endif -%}
|
| 40 |
+
{%- endfor -%}
|
| 41 |
+
{%- endif -%}
|
| 42 |
+
<|im_end|>
|
| 43 |
+
{%- endfor -%}
|
| 44 |
+
{%- if add_generation_prompt -%}
|
| 45 |
+
<|im_assistant|>assistant<|im_middle|>
|
| 46 |
+
{%- endif -%}
|
config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
configuration_deepseek.py
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copy from https://huggingface.co/deepseek-ai/DeepSeek-V3/blob/main/configuration_deepseek.py
|
| 2 |
+
|
| 3 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 4 |
+
from transformers.utils import logging
|
| 5 |
+
|
| 6 |
+
logger = logging.get_logger(__name__)
|
| 7 |
+
|
| 8 |
+
DEEPSEEK_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
|
| 9 |
+
class DeepseekV3Config(PretrainedConfig):
|
| 10 |
+
r"""
|
| 11 |
+
This is the configuration class to store the configuration of a [`DeepseekV3Model`]. It is used to instantiate an DeepSeek
|
| 12 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
| 13 |
+
defaults will yield a similar configuration to that of the DeepSeek-V3.
|
| 14 |
+
|
| 15 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
| 16 |
+
documentation from [`PretrainedConfig`] for more information.
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
Args:
|
| 20 |
+
vocab_size (`int`, *optional*, defaults to 129280):
|
| 21 |
+
Vocabulary size of the Deep model. Defines the number of different tokens that can be represented by the
|
| 22 |
+
`inputs_ids` passed when calling [`DeepseekV3Model`]
|
| 23 |
+
hidden_size (`int`, *optional*, defaults to 4096):
|
| 24 |
+
Dimension of the hidden representations.
|
| 25 |
+
intermediate_size (`int`, *optional*, defaults to 11008):
|
| 26 |
+
Dimension of the MLP representations.
|
| 27 |
+
moe_intermediate_size (`int`, *optional*, defaults to 1407):
|
| 28 |
+
Dimension of the MoE representations.
|
| 29 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
| 30 |
+
Number of hidden layers in the Transformer decoder.
|
| 31 |
+
num_nextn_predict_layers (`int`, *optional*, defaults to 1):
|
| 32 |
+
Number of nextn predict layers in the DeepSeekV3 Model.
|
| 33 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
| 34 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
| 35 |
+
n_shared_experts (`int`, *optional*, defaults to None):
|
| 36 |
+
Number of shared experts, None means dense model.
|
| 37 |
+
n_routed_experts (`int`, *optional*, defaults to None):
|
| 38 |
+
Number of routed experts, None means dense model.
|
| 39 |
+
routed_scaling_factor (`float`, *optional*, defaults to 1.0):
|
| 40 |
+
Scaling factor or routed experts.
|
| 41 |
+
topk_method (`str`, *optional*, defaults to `gready`):
|
| 42 |
+
Topk method used in routed gate.
|
| 43 |
+
n_group (`int`, *optional*, defaults to None):
|
| 44 |
+
Number of groups for routed experts.
|
| 45 |
+
topk_group (`int`, *optional*, defaults to None):
|
| 46 |
+
Number of selected groups for each token(for each token, ensuring the selected experts is only within `topk_group` groups).
|
| 47 |
+
num_experts_per_tok (`int`, *optional*, defaults to None):
|
| 48 |
+
Number of selected experts, None means dense model.
|
| 49 |
+
moe_layer_freq (`int`, *optional*, defaults to 1):
|
| 50 |
+
The frequency of the MoE layer: one expert layer for every `moe_layer_freq - 1` dense layers.
|
| 51 |
+
first_k_dense_replace (`int`, *optional*, defaults to 0):
|
| 52 |
+
Number of dense layers in shallow layers(embed->dense->dense->...->dense->moe->moe...->lm_head).
|
| 53 |
+
\--k dense layers--/
|
| 54 |
+
norm_topk_prob (`bool`, *optional*, defaults to False):
|
| 55 |
+
Whether to normalize the weights of the routed experts.
|
| 56 |
+
scoring_func (`str`, *optional*, defaults to 'softmax'):
|
| 57 |
+
Method of computing expert weights.
|
| 58 |
+
aux_loss_alpha (`float`, *optional*, defaults to 0.001):
|
| 59 |
+
Auxiliary loss weight coefficient.
|
| 60 |
+
seq_aux = (`bool`, *optional*, defaults to True):
|
| 61 |
+
Whether to compute the auxiliary loss for each individual sample.
|
| 62 |
+
num_key_value_heads (`int`, *optional*):
|
| 63 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
| 64 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
| 65 |
+
`num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
| 66 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
| 67 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
| 68 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
| 69 |
+
`num_attention_heads`.
|
| 70 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
| 71 |
+
The non-linear activation function (function or string) in the decoder.
|
| 72 |
+
max_position_embeddings (`int`, *optional*, defaults to 2048):
|
| 73 |
+
The maximum sequence length that this model might ever be used with.
|
| 74 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
| 75 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
| 76 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-06):
|
| 77 |
+
The epsilon used by the rms normalization layers.
|
| 78 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
| 79 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
| 80 |
+
relevant if `config.is_decoder=True`.
|
| 81 |
+
pad_token_id (`int`, *optional*):
|
| 82 |
+
Padding token id.
|
| 83 |
+
bos_token_id (`int`, *optional*, defaults to 1):
|
| 84 |
+
Beginning of stream token id.
|
| 85 |
+
eos_token_id (`int`, *optional*, defaults to 2):
|
| 86 |
+
End of stream token id.
|
| 87 |
+
pretraining_tp (`int`, *optional*, defaults to 1):
|
| 88 |
+
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
|
| 89 |
+
document](https://huggingface.co/docs/transformers/parallelism) to understand more about it. This value is
|
| 90 |
+
necessary to ensure exact reproducibility of the pretraining results. Please refer to [this
|
| 91 |
+
issue](https://github.com/pytorch/pytorch/issues/76232).
|
| 92 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
| 93 |
+
Whether to tie weight embeddings
|
| 94 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
| 95 |
+
The base period of the RoPE embeddings.
|
| 96 |
+
rope_scaling (`Dict`, *optional*):
|
| 97 |
+
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
|
| 98 |
+
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
|
| 99 |
+
`{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
|
| 100 |
+
`max_position_embeddings` to the expected new maximum.
|
| 101 |
+
attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
|
| 102 |
+
Whether to use a bias in the query, key, value and output projection layers during self-attention.
|
| 103 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
| 104 |
+
The dropout ratio for the attention probabilities.
|
| 105 |
+
|
| 106 |
+
```python
|
| 107 |
+
>>> from transformers import DeepseekV3Model, DeepseekV3Config
|
| 108 |
+
|
| 109 |
+
>>> # Initializing a Deepseek-V3 style configuration
|
| 110 |
+
>>> configuration = DeepseekV3Config()
|
| 111 |
+
|
| 112 |
+
>>> # Accessing the model configuration
|
| 113 |
+
>>> configuration = model.config
|
| 114 |
+
```"""
|
| 115 |
+
|
| 116 |
+
model_type = "deepseek_v3"
|
| 117 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 118 |
+
|
| 119 |
+
def __init__(
|
| 120 |
+
self,
|
| 121 |
+
vocab_size=129280,
|
| 122 |
+
hidden_size=7168,
|
| 123 |
+
intermediate_size=18432,
|
| 124 |
+
moe_intermediate_size = 2048,
|
| 125 |
+
num_hidden_layers=61,
|
| 126 |
+
num_nextn_predict_layers=1,
|
| 127 |
+
num_attention_heads=128,
|
| 128 |
+
num_key_value_heads=128,
|
| 129 |
+
n_shared_experts = 1,
|
| 130 |
+
n_routed_experts = 256,
|
| 131 |
+
ep_size = 1,
|
| 132 |
+
routed_scaling_factor = 2.5,
|
| 133 |
+
kv_lora_rank = 512,
|
| 134 |
+
q_lora_rank = 1536,
|
| 135 |
+
qk_rope_head_dim = 64,
|
| 136 |
+
v_head_dim = 128,
|
| 137 |
+
qk_nope_head_dim = 128,
|
| 138 |
+
topk_method = 'noaux_tc',
|
| 139 |
+
n_group = 8,
|
| 140 |
+
topk_group = 4,
|
| 141 |
+
num_experts_per_tok = 8,
|
| 142 |
+
moe_layer_freq = 1,
|
| 143 |
+
first_k_dense_replace = 3,
|
| 144 |
+
norm_topk_prob = True,
|
| 145 |
+
scoring_func = 'sigmoid',
|
| 146 |
+
aux_loss_alpha = 0.001,
|
| 147 |
+
seq_aux = True,
|
| 148 |
+
hidden_act="silu",
|
| 149 |
+
max_position_embeddings=4096,
|
| 150 |
+
initializer_range=0.02,
|
| 151 |
+
rms_norm_eps=1e-6,
|
| 152 |
+
use_cache=True,
|
| 153 |
+
pad_token_id=None,
|
| 154 |
+
bos_token_id=0,
|
| 155 |
+
eos_token_id=1,
|
| 156 |
+
pretraining_tp=1,
|
| 157 |
+
tie_word_embeddings=False,
|
| 158 |
+
rope_theta=10000.0,
|
| 159 |
+
rope_scaling=None,
|
| 160 |
+
attention_bias=False,
|
| 161 |
+
attention_dropout=0.0,
|
| 162 |
+
**kwargs,
|
| 163 |
+
):
|
| 164 |
+
self.vocab_size = vocab_size
|
| 165 |
+
self.max_position_embeddings = max_position_embeddings
|
| 166 |
+
self.hidden_size = hidden_size
|
| 167 |
+
self.intermediate_size = intermediate_size
|
| 168 |
+
self.moe_intermediate_size = moe_intermediate_size
|
| 169 |
+
self.num_hidden_layers = num_hidden_layers
|
| 170 |
+
self.num_nextn_predict_layers = num_nextn_predict_layers
|
| 171 |
+
self.num_attention_heads = num_attention_heads
|
| 172 |
+
self.n_shared_experts = n_shared_experts
|
| 173 |
+
self.n_routed_experts = n_routed_experts
|
| 174 |
+
self.ep_size = ep_size
|
| 175 |
+
self.routed_scaling_factor = routed_scaling_factor
|
| 176 |
+
self.kv_lora_rank = kv_lora_rank
|
| 177 |
+
self.q_lora_rank = q_lora_rank
|
| 178 |
+
self.qk_rope_head_dim = qk_rope_head_dim
|
| 179 |
+
self.v_head_dim = v_head_dim
|
| 180 |
+
self.qk_nope_head_dim = qk_nope_head_dim
|
| 181 |
+
self.topk_method = topk_method
|
| 182 |
+
self.n_group = n_group
|
| 183 |
+
self.topk_group = topk_group
|
| 184 |
+
self.num_experts_per_tok = num_experts_per_tok
|
| 185 |
+
self.moe_layer_freq = moe_layer_freq
|
| 186 |
+
self.first_k_dense_replace = first_k_dense_replace
|
| 187 |
+
self.norm_topk_prob = norm_topk_prob
|
| 188 |
+
self.scoring_func = scoring_func
|
| 189 |
+
self.aux_loss_alpha = aux_loss_alpha
|
| 190 |
+
self.seq_aux = seq_aux
|
| 191 |
+
# for backward compatibility
|
| 192 |
+
if num_key_value_heads is None:
|
| 193 |
+
num_key_value_heads = num_attention_heads
|
| 194 |
+
|
| 195 |
+
self.num_key_value_heads = num_key_value_heads
|
| 196 |
+
self.hidden_act = hidden_act
|
| 197 |
+
self.initializer_range = initializer_range
|
| 198 |
+
self.rms_norm_eps = rms_norm_eps
|
| 199 |
+
self.pretraining_tp = pretraining_tp
|
| 200 |
+
self.use_cache = use_cache
|
| 201 |
+
self.rope_theta = rope_theta
|
| 202 |
+
self.rope_scaling = rope_scaling
|
| 203 |
+
self.attention_bias = attention_bias
|
| 204 |
+
self.attention_dropout = attention_dropout
|
| 205 |
+
|
| 206 |
+
super().__init__(
|
| 207 |
+
pad_token_id=pad_token_id,
|
| 208 |
+
bos_token_id=bos_token_id,
|
| 209 |
+
eos_token_id=eos_token_id,
|
| 210 |
+
tie_word_embeddings=tie_word_embeddings,
|
| 211 |
+
**kwargs,
|
| 212 |
+
)
|
generation_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_length": 131072,
|
| 3 |
+
"eos_token_id": 163586
|
| 4 |
+
}
|
model-00001-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c1cb5d2ca6260a5f977366e4113a10d7eb9b11dfb0a41d5a387e6b78a156c84
|
| 3 |
+
size 4143384830
|
model-00002-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0116380da643a0711a1fae51884c167857425adb256a83118ad2624d3145ef5f
|
| 3 |
+
size 4638426467
|
model-00003-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9cdc0b243a00543def0e4b71a6a68eef30e803271709e0a0f5a8d42b59a12dba
|
| 3 |
+
size 3523216150
|
model-00004-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:31d94b940afc2104942b1fe82eb97e8c8a52fd84a45e9a6595a9840ce26e7133
|
| 3 |
+
size 4638426523
|
model-00005-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fe413225dd654b03741d78e357f1d00ab0506bfe9a320ffac4dfb892c73ab88d
|
| 3 |
+
size 3523216144
|
model-00006-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1a87bbd3fcfa82be477c23b76af1b5569c6fe6d84ff95cbc8f396d5dd9a07a6e
|
| 3 |
+
size 4638426481
|
model-00007-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9709a35fa9d559a2e58072092df01663529aa1a6cf6e860dd0d25452ba0b66bb
|
| 3 |
+
size 3523216150
|
model-00008-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c510e8805edadfcd135ffe547002fa43244e6e9e1ecee94682c50f4cd1c6279c
|
| 3 |
+
size 4638426471
|
model-00009-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:489609f57ce8b7c46be2449ac516b4f65548178149c670dbf34eea8e5210e76b
|
| 3 |
+
size 3523216148
|
model-00010-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:26191494268736ccce7c83259cf0c404eacb237a977b4fc3639368d4e8f7cbd6
|
| 3 |
+
size 4638426477
|
model-00011-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6847db489dec82cae08ad8a95b1f73b6155860d910fc2242fff2eb1eec86ec3
|
| 3 |
+
size 3523216146
|
model-00012-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:719d2b8c5b9594705b7489204aa25a0cc4bcb0969d21a4d6be0adf996a42737e
|
| 3 |
+
size 4638426495
|
model-00013-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0e0800f1c4d15eb28a2c663d93eaf8b88813dd38f1617b369989496236bb54ef
|
| 3 |
+
size 5335730261
|
model-00014-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eb8c335942baf846bcc0b44f1953e11a7106de1830ef974512298e3a7a9dd763
|
| 3 |
+
size 5335730293
|
model-00015-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b27e5e1af7b0bef56661b0d8a43989b85561250ceb2ea0a0956c0325ff598ce7
|
| 3 |
+
size 3523216148
|
model-00016-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:465bc3ca8e28943e1b5ee6311895cb87f9e393c90a5da5c201a03d3eed14e4f8
|
| 3 |
+
size 4638426490
|
model-00017-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f4a484766296fa17de3bfec28676e7be22c7a0ca787c03134f65441b17cc530f
|
| 3 |
+
size 5335730270
|
model-00018-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:75124c521b5b38321d8fda10c1f9b0e319c63ec7025866140d383a1d4a785d88
|
| 3 |
+
size 5335730314
|
model-00019-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5f2de9422e8adcb923aa83e6077c8f7c1b7b2e3e24ace4a13824081fd0b54eac
|
| 3 |
+
size 3523216156
|
model-00020-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9ae7865c031727113039403a6344734a6c1c47018e1747fb82ab94255c5ced84
|
| 3 |
+
size 4638426534
|
model-00021-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8393a439ac884112162af7de4691782ea632766261d48c9052735497723037ca
|
| 3 |
+
size 5335730338
|
model-00022-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a012687e9e205e3f1b77e68daa16f0b000532eeccdff02c2e32298c7688d42b3
|
| 3 |
+
size 5335730302
|
model-00023-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8092bc6e8ba40b23d77e134105d19713a4fcf05781f5273311c1556746a278b4
|
| 3 |
+
size 3523216150
|
model-00024-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:755804a6767195fd2adf8f6a064962295ee7ffb2e04e706465c45779815d4572
|
| 3 |
+
size 4638426524
|
model-00025-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4938d3f405bf59ed4cc849823780fd21d4c4fc2ef7397a44ff735b6e910d9520
|
| 3 |
+
size 5335730316
|
model-00026-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:545bc4c31d379276fb2888410b94113e99dcd8b5cae5bf63f13ede9e49a8a696
|
| 3 |
+
size 5335730332
|
model-00027-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:64ada37ee5a30cfae3e70466e4da8f53039e6fd097bcabad9d1b1ba0634ede9c
|
| 3 |
+
size 3523216158
|
model-00028-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b71a42edb95128095a271f501b551d93eec63619a342cd105c4da4b4502abe88
|
| 3 |
+
size 4638426480
|
model-00029-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d107910a2927caa4d2f13c5f9ccb8ad0e38b7dc96319ac7f847112c8e021c1f
|
| 3 |
+
size 5335730354
|
model-00030-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1acea7a32954b79c9fd0bedd0b810fe8c174f3e72a9ec877b57fc31d25150bb
|
| 3 |
+
size 5335730306
|
model-00031-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:93cffafe2b52890f9bdd0105bb8f43743c74fdb9c4b4287bd38991fa8d169a95
|
| 3 |
+
size 3523216150
|
model-00032-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ccd8d2f052824155841b280eb26652f5566e45186f19a47a91db53c2245ca687
|
| 3 |
+
size 4638426510
|
model-00033-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0eae2fcac32287116a124bf61229c988c2d3e5ed6f9026b90eadb3469723c972
|
| 3 |
+
size 5335730288
|
model-00034-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a009fcdded01dce38754d517aaa1387ad7703f59ade8651e57a77aad27648034
|
| 3 |
+
size 5335730336
|
model-00035-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:356ba5a0264072e3ff6ff218b24065b097741387756dd80ed6e62293bb0ca06d
|
| 3 |
+
size 3523216150
|
model-00036-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5b140f09269facdd8b8ec1024af2e198b50dea19264de9c9f61f8f66c937d731
|
| 3 |
+
size 4638426492
|
model-00037-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a06c04679561098bb49fa881cc212e5a0c07e4673d4596aaef5fd3cc0a4261fa
|
| 3 |
+
size 5335730318
|
model-00038-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aa4b53975efe8f42e7b16fb2d2cd2a4cc2dfe57870fdebcda78bf58051355e5a
|
| 3 |
+
size 5335730320
|
model-00039-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4b8cea975871301dbd55918bb387bae92a6da659515e5ea7ac35a7775ef2b0bf
|
| 3 |
+
size 3523216156
|
model-00040-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae7a3e4828e7184b7accb8ac48c010a6621cc1f8775b6c28263b5a2e6c13b7b7
|
| 3 |
+
size 4638426518
|
model-00041-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc9770047a50c9ef420e6ccd636eee443c6e4550f79abd4dcb628b7466f06814
|
| 3 |
+
size 5335730332
|
model-00042-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c9b0b4deda164ca594cd30b0cfe2f36a6aea42b0bee62a4867bb7deafd7e4917
|
| 3 |
+
size 5335730340
|
model-00043-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:67f04040402046a8721769bde1c0c5f7755e8f18e08d904e6663b33412363a13
|
| 3 |
+
size 3523216156
|
model-00044-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:05b49ab5c1f4f4f8ac4ee7c164c36110e0b13d0ee9e1425c65901b753e633ccf
|
| 3 |
+
size 4638426526
|
model-00045-of-00090.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:809e681378dbb5269590ba7cadafed54f161da46ffbec296a4524b0d64c403a1
|
| 3 |
+
size 5335730342
|