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
- README.md +204 -0
- chat_template.jinja +43 -0
- config.json +1007 -0
- configuration_deepseek.py +212 -0
- generation_config.json +5 -0
- model-00001-of-00108.safetensors +3 -0
- model-00002-of-00108.safetensors +3 -0
- model-00003-of-00108.safetensors +3 -0
- model-00004-of-00108.safetensors +3 -0
- model-00005-of-00108.safetensors +3 -0
- model-00006-of-00108.safetensors +3 -0
- model-00007-of-00108.safetensors +3 -0
- model-00008-of-00108.safetensors +3 -0
- model-00009-of-00108.safetensors +3 -0
- model-00010-of-00108.safetensors +3 -0
- model-00011-of-00108.safetensors +3 -0
- model-00012-of-00108.safetensors +3 -0
- model-00013-of-00108.safetensors +3 -0
- model-00014-of-00108.safetensors +3 -0
- model-00015-of-00108.safetensors +3 -0
- model-00016-of-00108.safetensors +3 -0
- model-00017-of-00108.safetensors +3 -0
- model-00018-of-00108.safetensors +3 -0
- model-00019-of-00108.safetensors +3 -0
- model-00020-of-00108.safetensors +3 -0
- model-00021-of-00108.safetensors +3 -0
- model-00022-of-00108.safetensors +3 -0
- model-00023-of-00108.safetensors +3 -0
- model-00024-of-00108.safetensors +3 -0
- model-00025-of-00108.safetensors +3 -0
- model-00026-of-00108.safetensors +3 -0
- model-00027-of-00108.safetensors +3 -0
- model-00028-of-00108.safetensors +3 -0
- model-00029-of-00108.safetensors +3 -0
- model-00030-of-00108.safetensors +3 -0
- model-00031-of-00108.safetensors +3 -0
- model-00032-of-00108.safetensors +3 -0
- model-00033-of-00108.safetensors +3 -0
- model-00034-of-00108.safetensors +3 -0
- model-00035-of-00108.safetensors +3 -0
- model-00036-of-00108.safetensors +3 -0
- model-00037-of-00108.safetensors +3 -0
- model-00038-of-00108.safetensors +3 -0
- model-00039-of-00108.safetensors +3 -0
- model-00040-of-00108.safetensors +3 -0
- model-00041-of-00108.safetensors +3 -0
- model-00042-of-00108.safetensors +3 -0
- model-00043-of-00108.safetensors +3 -0
- model-00044-of-00108.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
|
README.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
datasets:
|
| 3 |
+
- NeelNanda/pile-10k
|
| 4 |
+
base_model:
|
| 5 |
+
- moonshotai/Kimi-K2-Instruct
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
## Model Details
|
| 9 |
+
|
| 10 |
+
This model is an mixed int4 model with group_size 128 and symmetric quantization of [moonshotai/Kimi-K2-Instruct](https://huggingface.co/moonshotai/Kimi-K2-Instruct) generated by [intel/auto-round](https://github.com/intel/auto-round) algorithm. Non expert layers are fallback to 8 bits. Please refer to Section Generate the model for more details.
|
| 11 |
+
Please follow the license of the original model.
|
| 12 |
+
|
| 13 |
+
## How To Use
|
| 14 |
+
|
| 15 |
+
**Due to kernel issue, this model could only run on CPU**
|
| 16 |
+
|
| 17 |
+
### INT4 Inference(CPU)
|
| 18 |
+
```python
|
| 19 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 20 |
+
import transformers
|
| 21 |
+
from auto_round import AutoRound, AutoRoundConfig
|
| 22 |
+
|
| 23 |
+
import torch
|
| 24 |
+
|
| 25 |
+
quantized_model_dir = "Intel/Kimi-K2-Instruct-int4-mixed-AutoRound-cpu"
|
| 26 |
+
|
| 27 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 28 |
+
quantized_model_dir,
|
| 29 |
+
torch_dtype=torch.bfloat16,
|
| 30 |
+
device_map="cpu",
|
| 31 |
+
)
|
| 32 |
+
tokenizer = AutoTokenizer.from_pretrained(quantized_model_dir, trust_remote_code=True)
|
| 33 |
+
prompts = [
|
| 34 |
+
"9.11和9.8哪个数字大",
|
| 35 |
+
"strawberry中有几个r?",
|
| 36 |
+
"There is a girl who likes adventure,",
|
| 37 |
+
"Please give a brief introduction of Moonshot AI",
|
| 38 |
+
]
|
| 39 |
+
|
| 40 |
+
texts=[]
|
| 41 |
+
for prompt in prompts:
|
| 42 |
+
messages = [
|
| 43 |
+
{"role": "system", "content": "You are Kimi, an AI assistant created by Moonshot AI."},
|
| 44 |
+
{"role": "user", "content": [{"type": "text", "text":prompt}]}
|
| 45 |
+
]
|
| 46 |
+
text = tokenizer.apply_chat_template(
|
| 47 |
+
messages,
|
| 48 |
+
tokenize=False,
|
| 49 |
+
add_generation_prompt=True
|
| 50 |
+
)
|
| 51 |
+
texts.append(text)
|
| 52 |
+
inputs = tokenizer(texts, return_tensors="pt", padding=True, truncation=True)
|
| 53 |
+
|
| 54 |
+
outputs = model.generate(
|
| 55 |
+
input_ids=inputs["input_ids"].to(model.device),
|
| 56 |
+
attention_mask=inputs["attention_mask"].to(model.device),
|
| 57 |
+
max_length=200, ##change this to align with the official usage
|
| 58 |
+
num_return_sequences=1,
|
| 59 |
+
do_sample=False ##change this to align with the official usage
|
| 60 |
+
)
|
| 61 |
+
generated_ids = [
|
| 62 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(inputs["input_ids"], outputs)
|
| 63 |
+
]
|
| 64 |
+
|
| 65 |
+
decoded_outputs = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)
|
| 66 |
+
|
| 67 |
+
for i, prompt in enumerate(prompts):
|
| 68 |
+
input_id = inputs
|
| 69 |
+
print(f"Prompt: {prompt}")
|
| 70 |
+
print(f"Generated: {decoded_outputs[i]}")
|
| 71 |
+
print("-" * 50)
|
| 72 |
+
"""
|
| 73 |
+
Prompt: 9.11和9.8哪个数字大
|
| 74 |
+
Generated: ### 第一步:理解题目
|
| 75 |
+
|
| 76 |
+
首先,我需要明确题目在问什么。题目给出了两个数字:9.11和9.8,问哪一个更大。这看起来是一个简单的数值比较问题。
|
| 77 |
+
|
| 78 |
+
### 第二步:数字的表示
|
| 79 |
+
|
| 80 |
+
这两个数字都是小数,即带有小数部分的数字。小数由整数部分和小数部分组成,小数点左边是整数部分,右边是小数部分。
|
| 81 |
+
|
| 82 |
+
- 9.11:整数部分是9,小数部分是11。
|
| 83 |
+
- 9.8:整数部分是9,小数部分是8。
|
| 84 |
+
|
| 85 |
+
### 第三步:比较整数部分
|
| 86 |
+
|
| 87 |
+
首先比较两个数的整数部分:
|
| 88 |
+
|
| 89 |
+
- 9.11的整数部分是9。
|
| 90 |
+
- 9.8的整数部分也是9。
|
| 91 |
+
|
| 92 |
+
整数部分相同,因此需要比较小数部分。
|
| 93 |
+
|
| 94 |
+
### 第四步:比较小数部分
|
| 95 |
+
|
| 96 |
+
小数部分的比较
|
| 97 |
+
--------------------------------------------------
|
| 98 |
+
Prompt: strawberry中有几个r?
|
| 99 |
+
Generated: ### 问题重述
|
| 100 |
+
我们需要计算单词 "strawberry" 中有多少个字母 "r"。
|
| 101 |
+
|
| 102 |
+
### 步骤分解
|
| 103 |
+
1. **写出单词**:首先,将单词 "strawberry" 完整地写出来。
|
| 104 |
+
2. **逐个字母检查**:从左到右,逐个字母查看是否是 "r"(注意大小写,但这里都是小写)。
|
| 105 |
+
3. **计数**:每遇到一个 "r",就增加计数器。
|
| 106 |
+
|
| 107 |
+
### 详细检查
|
| 108 |
+
让我们将 "strawberry" 拆分开来:
|
| 109 |
+
|
| 110 |
+
字母位置及字母:
|
| 111 |
+
1. s
|
| 112 |
+
2. t
|
| 113 |
+
3. r
|
| 114 |
+
4. a
|
| 115 |
+
5. w
|
| 116 |
+
6. b
|
| 117 |
+
7. e
|
| 118 |
+
8. r
|
| 119 |
+
9. r
|
| 120 |
+
10. y
|
| 121 |
+
|
| 122 |
+
现在,我们检查每个字母是否为 "r":
|
| 123 |
+
|
| 124 |
+
-
|
| 125 |
+
--------------------------------------------------
|
| 126 |
+
Prompt: There is a girl who likes adventure,
|
| 127 |
+
Generated: There is a girl who likes adventure,
|
| 128 |
+
so she ties her shoes with sunrise instead of laces,
|
| 129 |
+
lets the wind pick the next city,
|
| 130 |
+
and trades her shadow for a passport stamp.
|
| 131 |
+
|
| 132 |
+
She keeps her memories in mason jars—
|
| 133 |
+
one holds the scent of monsoon in Mumbai,
|
| 134 |
+
another the hush of Icelandic snow.
|
| 135 |
+
When homesick, she unscrews a lid,
|
| 136 |
+
inhales, and is gone again.
|
| 137 |
+
|
| 138 |
+
She once outran her own name
|
| 139 |
+
somewhere between Marrakesh and the moon,
|
| 140 |
+
answering only to “Hey, you with the constellations in your hair.”
|
| 141 |
+
Maps are her love letters;
|
| 142 |
+
she folds them into paper boats
|
| 143 |
+
and sails them down hotel bathtubs,
|
| 144 |
+
whispering, *Find me where the water ends.*
|
| 145 |
+
--------------------------------------------------
|
| 146 |
+
Prompt: Please give a brief introduction of Moonshot AI
|
| 147 |
+
Generated: Moonshot AI is a Chinese artificial-intelligence company founded in 2023 and headquartered in Beijing. Focused on large-scale language models and related products, it released its first model, Kimi, in October 2023 and has since launched upgraded versions such as Kimi 1.5. The company closed a US$1 billion funding round in early 2024 that valued it at about US$2.5 billion, making it one of China’s best-funded AI start-ups.
|
| 148 |
+
--------------------------------------------------
|
| 149 |
+
|
| 150 |
+
"""
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
### Generate the model
|
| 154 |
+
```python
|
| 155 |
+
import torch
|
| 156 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 157 |
+
import transformers
|
| 158 |
+
|
| 159 |
+
model_name = "Kimi-K2-Instruct-BF16"
|
| 160 |
+
|
| 161 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name,trust_remote_code=True)
|
| 162 |
+
model = AutoModelForCausalLM.from_pretrained(model_name,device_map="cpu", torch_dtype="auto",trust_remote_code=True)
|
| 163 |
+
|
| 164 |
+
layer_config = {}
|
| 165 |
+
for n, m in model.named_modules():
|
| 166 |
+
if isinstance(m, torch.nn.Linear):
|
| 167 |
+
if "expert" in n or "shared_experts" in n:
|
| 168 |
+
layer_config[n] = {"bits": 4}
|
| 169 |
+
print(n, 4)
|
| 170 |
+
else:
|
| 171 |
+
layer_config[n] = {"bits": 8}
|
| 172 |
+
print(n, 8)
|
| 173 |
+
|
| 174 |
+
from auto_round import AutoRound
|
| 175 |
+
|
| 176 |
+
autoround = AutoRound(model, tokenizer, iters=0, layer_config=layer_config)
|
| 177 |
+
autoround.quantize_and_save(format="auto_round", output_dir="tmp_autoround")
|
| 178 |
+
|
| 179 |
+
```
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
## Ethical Considerations and Limitations
|
| 183 |
+
|
| 184 |
+
The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
|
| 185 |
+
|
| 186 |
+
Therefore, before deploying any applications of the model, developers should perform safety testing.
|
| 187 |
+
|
| 188 |
+
## Caveats and Recommendations
|
| 189 |
+
|
| 190 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
|
| 191 |
+
|
| 192 |
+
Here are a couple of useful links to learn more about Intel's AI software:
|
| 193 |
+
|
| 194 |
+
- Intel Neural Compressor [link](https://github.com/intel/neural-compressor)
|
| 195 |
+
|
| 196 |
+
## Disclaimer
|
| 197 |
+
|
| 198 |
+
The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
|
| 199 |
+
|
| 200 |
+
## Cite
|
| 201 |
+
|
| 202 |
+
@article{cheng2023optimize, title={Optimize weight rounding via signed gradient descent for the quantization of llms}, author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi}, journal={arXiv preprint arXiv:2309.05516}, year={2023} }
|
| 203 |
+
|
| 204 |
+
[arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools -%}
|
| 2 |
+
<|im_system|>tool_declare<|im_middle|>{{ tools | tojson }}<|im_end|>
|
| 3 |
+
{%- endif -%}
|
| 4 |
+
{%- for message in messages -%}
|
| 5 |
+
{%- if loop.first and messages[0]['role'] != 'system' -%}
|
| 6 |
+
<|im_system|>system<|im_middle|>You are a helpful assistant<|im_end|>
|
| 7 |
+
{%- endif -%}
|
| 8 |
+
{%- if message['role'] == 'system' -%}
|
| 9 |
+
<|im_system|>system<|im_middle|>
|
| 10 |
+
{%- elif message['role'] == 'user' -%}
|
| 11 |
+
<|im_user|>user<|im_middle|>
|
| 12 |
+
{%- elif message['role'] == 'assistant' -%}
|
| 13 |
+
<|im_assistant|>assistant<|im_middle|>
|
| 14 |
+
{%- elif message['role'] == 'tool' -%}
|
| 15 |
+
<|im_system|>tool<|im_middle|>
|
| 16 |
+
{%- endif -%}
|
| 17 |
+
{%- if message['role'] == 'assistant' and message.get('tool_calls') -%}
|
| 18 |
+
{%- if message['content'] -%}{{ message['content'] }}{%- endif -%}
|
| 19 |
+
<|tool_calls_section_begin|>
|
| 20 |
+
{%- for tool_call in message['tool_calls'] -%}
|
| 21 |
+
{%- set func_name = tool_call['function']['name'] -%}
|
| 22 |
+
{%- set formatted_id = 'functions.' + func_name + ':' + loop.index0|string -%}
|
| 23 |
+
<|tool_call_begin|>{{ formatted_id }}<|tool_call_argument_begin|>{{ tool_call['function']['arguments'] | tojson}}<|tool_call_end|>
|
| 24 |
+
{%- endfor -%}
|
| 25 |
+
<|tool_calls_section_end|>
|
| 26 |
+
{%- elif message['role'] == 'tool' -%}
|
| 27 |
+
## Return of {{ message.tool_call_id }}\n{{ message['content'] }}
|
| 28 |
+
{%- elif message['content'] is string -%}
|
| 29 |
+
{{ message['content'] }}
|
| 30 |
+
{%- elif message['content'] is not none -%}
|
| 31 |
+
{% for content in message['content'] -%}
|
| 32 |
+
{% if content['type'] == 'image' or 'image' in content or 'image_url' in content -%}
|
| 33 |
+
<|media_start|>image<|media_content|><|media_pad|><|media_end|>
|
| 34 |
+
{% else -%}
|
| 35 |
+
{{ content['text'] }}
|
| 36 |
+
{%- endif -%}
|
| 37 |
+
{%- endfor -%}
|
| 38 |
+
{%- endif -%}
|
| 39 |
+
<|im_end|>
|
| 40 |
+
{%- endfor -%}
|
| 41 |
+
{%- if add_generation_prompt -%}
|
| 42 |
+
<|im_assistant|>assistant<|im_middle|>
|
| 43 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,1007 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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": 163584,
|
| 14 |
+
"eos_token_id": 163585,
|
| 15 |
+
"ep_size": 1,
|
| 16 |
+
"first_k_dense_replace": 1,
|
| 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": 131072,
|
| 23 |
+
"model_type": "deepseek_v3",
|
| 24 |
+
"moe_intermediate_size": 2048,
|
| 25 |
+
"moe_layer_freq": 1,
|
| 26 |
+
"n_group": 1,
|
| 27 |
+
"n_routed_experts": 384,
|
| 28 |
+
"n_shared_experts": 1,
|
| 29 |
+
"norm_topk_prob": true,
|
| 30 |
+
"num_attention_heads": 64,
|
| 31 |
+
"num_experts_per_tok": 8,
|
| 32 |
+
"num_hidden_layers": 61,
|
| 33 |
+
"num_key_value_heads": 64,
|
| 34 |
+
"num_nextn_predict_layers": 0,
|
| 35 |
+
"pad_token_id": 163839,
|
| 36 |
+
"pretraining_tp": 1,
|
| 37 |
+
"q_lora_rank": 1536,
|
| 38 |
+
"qk_nope_head_dim": 128,
|
| 39 |
+
"qk_rope_head_dim": 64,
|
| 40 |
+
"quantization_config": {
|
| 41 |
+
"autoround_version": "0.6.0",
|
| 42 |
+
"bits": 4,
|
| 43 |
+
"data_type": "int",
|
| 44 |
+
"extra_config": {
|
| 45 |
+
"lm_head": {
|
| 46 |
+
"bits": 8,
|
| 47 |
+
"data_type": "int",
|
| 48 |
+
"group_size": 128,
|
| 49 |
+
"sym": true
|
| 50 |
+
},
|
| 51 |
+
"model.layers.0.mlp.down_proj": {
|
| 52 |
+
"bits": 8
|
| 53 |
+
},
|
| 54 |
+
"model.layers.0.mlp.gate_proj": {
|
| 55 |
+
"bits": 8
|
| 56 |
+
},
|
| 57 |
+
"model.layers.0.mlp.up_proj": {
|
| 58 |
+
"bits": 8
|
| 59 |
+
},
|
| 60 |
+
"model.layers.0.self_attn.kv_a_proj_with_mqa": {
|
| 61 |
+
"bits": 8
|
| 62 |
+
},
|
| 63 |
+
"model.layers.0.self_attn.kv_b_proj": {
|
| 64 |
+
"bits": 8
|
| 65 |
+
},
|
| 66 |
+
"model.layers.0.self_attn.o_proj": {
|
| 67 |
+
"bits": 8
|
| 68 |
+
},
|
| 69 |
+
"model.layers.0.self_attn.q_a_proj": {
|
| 70 |
+
"bits": 8
|
| 71 |
+
},
|
| 72 |
+
"model.layers.0.self_attn.q_b_proj": {
|
| 73 |
+
"bits": 8
|
| 74 |
+
},
|
| 75 |
+
"model.layers.1.self_attn.kv_a_proj_with_mqa": {
|
| 76 |
+
"bits": 8
|
| 77 |
+
},
|
| 78 |
+
"model.layers.1.self_attn.kv_b_proj": {
|
| 79 |
+
"bits": 8
|
| 80 |
+
},
|
| 81 |
+
"model.layers.1.self_attn.o_proj": {
|
| 82 |
+
"bits": 8
|
| 83 |
+
},
|
| 84 |
+
"model.layers.1.self_attn.q_a_proj": {
|
| 85 |
+
"bits": 8
|
| 86 |
+
},
|
| 87 |
+
"model.layers.1.self_attn.q_b_proj": {
|
| 88 |
+
"bits": 8
|
| 89 |
+
},
|
| 90 |
+
"model.layers.10.self_attn.kv_a_proj_with_mqa": {
|
| 91 |
+
"bits": 8
|
| 92 |
+
},
|
| 93 |
+
"model.layers.10.self_attn.kv_b_proj": {
|
| 94 |
+
"bits": 8
|
| 95 |
+
},
|
| 96 |
+
"model.layers.10.self_attn.o_proj": {
|
| 97 |
+
"bits": 8
|
| 98 |
+
},
|
| 99 |
+
"model.layers.10.self_attn.q_a_proj": {
|
| 100 |
+
"bits": 8
|
| 101 |
+
},
|
| 102 |
+
"model.layers.10.self_attn.q_b_proj": {
|
| 103 |
+
"bits": 8
|
| 104 |
+
},
|
| 105 |
+
"model.layers.11.self_attn.kv_a_proj_with_mqa": {
|
| 106 |
+
"bits": 8
|
| 107 |
+
},
|
| 108 |
+
"model.layers.11.self_attn.kv_b_proj": {
|
| 109 |
+
"bits": 8
|
| 110 |
+
},
|
| 111 |
+
"model.layers.11.self_attn.o_proj": {
|
| 112 |
+
"bits": 8
|
| 113 |
+
},
|
| 114 |
+
"model.layers.11.self_attn.q_a_proj": {
|
| 115 |
+
"bits": 8
|
| 116 |
+
},
|
| 117 |
+
"model.layers.11.self_attn.q_b_proj": {
|
| 118 |
+
"bits": 8
|
| 119 |
+
},
|
| 120 |
+
"model.layers.12.self_attn.kv_a_proj_with_mqa": {
|
| 121 |
+
"bits": 8
|
| 122 |
+
},
|
| 123 |
+
"model.layers.12.self_attn.kv_b_proj": {
|
| 124 |
+
"bits": 8
|
| 125 |
+
},
|
| 126 |
+
"model.layers.12.self_attn.o_proj": {
|
| 127 |
+
"bits": 8
|
| 128 |
+
},
|
| 129 |
+
"model.layers.12.self_attn.q_a_proj": {
|
| 130 |
+
"bits": 8
|
| 131 |
+
},
|
| 132 |
+
"model.layers.12.self_attn.q_b_proj": {
|
| 133 |
+
"bits": 8
|
| 134 |
+
},
|
| 135 |
+
"model.layers.13.self_attn.kv_a_proj_with_mqa": {
|
| 136 |
+
"bits": 8
|
| 137 |
+
},
|
| 138 |
+
"model.layers.13.self_attn.kv_b_proj": {
|
| 139 |
+
"bits": 8
|
| 140 |
+
},
|
| 141 |
+
"model.layers.13.self_attn.o_proj": {
|
| 142 |
+
"bits": 8
|
| 143 |
+
},
|
| 144 |
+
"model.layers.13.self_attn.q_a_proj": {
|
| 145 |
+
"bits": 8
|
| 146 |
+
},
|
| 147 |
+
"model.layers.13.self_attn.q_b_proj": {
|
| 148 |
+
"bits": 8
|
| 149 |
+
},
|
| 150 |
+
"model.layers.14.self_attn.kv_a_proj_with_mqa": {
|
| 151 |
+
"bits": 8
|
| 152 |
+
},
|
| 153 |
+
"model.layers.14.self_attn.kv_b_proj": {
|
| 154 |
+
"bits": 8
|
| 155 |
+
},
|
| 156 |
+
"model.layers.14.self_attn.o_proj": {
|
| 157 |
+
"bits": 8
|
| 158 |
+
},
|
| 159 |
+
"model.layers.14.self_attn.q_a_proj": {
|
| 160 |
+
"bits": 8
|
| 161 |
+
},
|
| 162 |
+
"model.layers.14.self_attn.q_b_proj": {
|
| 163 |
+
"bits": 8
|
| 164 |
+
},
|
| 165 |
+
"model.layers.15.self_attn.kv_a_proj_with_mqa": {
|
| 166 |
+
"bits": 8
|
| 167 |
+
},
|
| 168 |
+
"model.layers.15.self_attn.kv_b_proj": {
|
| 169 |
+
"bits": 8
|
| 170 |
+
},
|
| 171 |
+
"model.layers.15.self_attn.o_proj": {
|
| 172 |
+
"bits": 8
|
| 173 |
+
},
|
| 174 |
+
"model.layers.15.self_attn.q_a_proj": {
|
| 175 |
+
"bits": 8
|
| 176 |
+
},
|
| 177 |
+
"model.layers.15.self_attn.q_b_proj": {
|
| 178 |
+
"bits": 8
|
| 179 |
+
},
|
| 180 |
+
"model.layers.16.self_attn.kv_a_proj_with_mqa": {
|
| 181 |
+
"bits": 8
|
| 182 |
+
},
|
| 183 |
+
"model.layers.16.self_attn.kv_b_proj": {
|
| 184 |
+
"bits": 8
|
| 185 |
+
},
|
| 186 |
+
"model.layers.16.self_attn.o_proj": {
|
| 187 |
+
"bits": 8
|
| 188 |
+
},
|
| 189 |
+
"model.layers.16.self_attn.q_a_proj": {
|
| 190 |
+
"bits": 8
|
| 191 |
+
},
|
| 192 |
+
"model.layers.16.self_attn.q_b_proj": {
|
| 193 |
+
"bits": 8
|
| 194 |
+
},
|
| 195 |
+
"model.layers.17.self_attn.kv_a_proj_with_mqa": {
|
| 196 |
+
"bits": 8
|
| 197 |
+
},
|
| 198 |
+
"model.layers.17.self_attn.kv_b_proj": {
|
| 199 |
+
"bits": 8
|
| 200 |
+
},
|
| 201 |
+
"model.layers.17.self_attn.o_proj": {
|
| 202 |
+
"bits": 8
|
| 203 |
+
},
|
| 204 |
+
"model.layers.17.self_attn.q_a_proj": {
|
| 205 |
+
"bits": 8
|
| 206 |
+
},
|
| 207 |
+
"model.layers.17.self_attn.q_b_proj": {
|
| 208 |
+
"bits": 8
|
| 209 |
+
},
|
| 210 |
+
"model.layers.18.self_attn.kv_a_proj_with_mqa": {
|
| 211 |
+
"bits": 8
|
| 212 |
+
},
|
| 213 |
+
"model.layers.18.self_attn.kv_b_proj": {
|
| 214 |
+
"bits": 8
|
| 215 |
+
},
|
| 216 |
+
"model.layers.18.self_attn.o_proj": {
|
| 217 |
+
"bits": 8
|
| 218 |
+
},
|
| 219 |
+
"model.layers.18.self_attn.q_a_proj": {
|
| 220 |
+
"bits": 8
|
| 221 |
+
},
|
| 222 |
+
"model.layers.18.self_attn.q_b_proj": {
|
| 223 |
+
"bits": 8
|
| 224 |
+
},
|
| 225 |
+
"model.layers.19.self_attn.kv_a_proj_with_mqa": {
|
| 226 |
+
"bits": 8
|
| 227 |
+
},
|
| 228 |
+
"model.layers.19.self_attn.kv_b_proj": {
|
| 229 |
+
"bits": 8
|
| 230 |
+
},
|
| 231 |
+
"model.layers.19.self_attn.o_proj": {
|
| 232 |
+
"bits": 8
|
| 233 |
+
},
|
| 234 |
+
"model.layers.19.self_attn.q_a_proj": {
|
| 235 |
+
"bits": 8
|
| 236 |
+
},
|
| 237 |
+
"model.layers.19.self_attn.q_b_proj": {
|
| 238 |
+
"bits": 8
|
| 239 |
+
},
|
| 240 |
+
"model.layers.2.self_attn.kv_a_proj_with_mqa": {
|
| 241 |
+
"bits": 8
|
| 242 |
+
},
|
| 243 |
+
"model.layers.2.self_attn.kv_b_proj": {
|
| 244 |
+
"bits": 8
|
| 245 |
+
},
|
| 246 |
+
"model.layers.2.self_attn.o_proj": {
|
| 247 |
+
"bits": 8
|
| 248 |
+
},
|
| 249 |
+
"model.layers.2.self_attn.q_a_proj": {
|
| 250 |
+
"bits": 8
|
| 251 |
+
},
|
| 252 |
+
"model.layers.2.self_attn.q_b_proj": {
|
| 253 |
+
"bits": 8
|
| 254 |
+
},
|
| 255 |
+
"model.layers.20.self_attn.kv_a_proj_with_mqa": {
|
| 256 |
+
"bits": 8
|
| 257 |
+
},
|
| 258 |
+
"model.layers.20.self_attn.kv_b_proj": {
|
| 259 |
+
"bits": 8
|
| 260 |
+
},
|
| 261 |
+
"model.layers.20.self_attn.o_proj": {
|
| 262 |
+
"bits": 8
|
| 263 |
+
},
|
| 264 |
+
"model.layers.20.self_attn.q_a_proj": {
|
| 265 |
+
"bits": 8
|
| 266 |
+
},
|
| 267 |
+
"model.layers.20.self_attn.q_b_proj": {
|
| 268 |
+
"bits": 8
|
| 269 |
+
},
|
| 270 |
+
"model.layers.21.self_attn.kv_a_proj_with_mqa": {
|
| 271 |
+
"bits": 8
|
| 272 |
+
},
|
| 273 |
+
"model.layers.21.self_attn.kv_b_proj": {
|
| 274 |
+
"bits": 8
|
| 275 |
+
},
|
| 276 |
+
"model.layers.21.self_attn.o_proj": {
|
| 277 |
+
"bits": 8
|
| 278 |
+
},
|
| 279 |
+
"model.layers.21.self_attn.q_a_proj": {
|
| 280 |
+
"bits": 8
|
| 281 |
+
},
|
| 282 |
+
"model.layers.21.self_attn.q_b_proj": {
|
| 283 |
+
"bits": 8
|
| 284 |
+
},
|
| 285 |
+
"model.layers.22.self_attn.kv_a_proj_with_mqa": {
|
| 286 |
+
"bits": 8
|
| 287 |
+
},
|
| 288 |
+
"model.layers.22.self_attn.kv_b_proj": {
|
| 289 |
+
"bits": 8
|
| 290 |
+
},
|
| 291 |
+
"model.layers.22.self_attn.o_proj": {
|
| 292 |
+
"bits": 8
|
| 293 |
+
},
|
| 294 |
+
"model.layers.22.self_attn.q_a_proj": {
|
| 295 |
+
"bits": 8
|
| 296 |
+
},
|
| 297 |
+
"model.layers.22.self_attn.q_b_proj": {
|
| 298 |
+
"bits": 8
|
| 299 |
+
},
|
| 300 |
+
"model.layers.23.self_attn.kv_a_proj_with_mqa": {
|
| 301 |
+
"bits": 8
|
| 302 |
+
},
|
| 303 |
+
"model.layers.23.self_attn.kv_b_proj": {
|
| 304 |
+
"bits": 8
|
| 305 |
+
},
|
| 306 |
+
"model.layers.23.self_attn.o_proj": {
|
| 307 |
+
"bits": 8
|
| 308 |
+
},
|
| 309 |
+
"model.layers.23.self_attn.q_a_proj": {
|
| 310 |
+
"bits": 8
|
| 311 |
+
},
|
| 312 |
+
"model.layers.23.self_attn.q_b_proj": {
|
| 313 |
+
"bits": 8
|
| 314 |
+
},
|
| 315 |
+
"model.layers.24.self_attn.kv_a_proj_with_mqa": {
|
| 316 |
+
"bits": 8
|
| 317 |
+
},
|
| 318 |
+
"model.layers.24.self_attn.kv_b_proj": {
|
| 319 |
+
"bits": 8
|
| 320 |
+
},
|
| 321 |
+
"model.layers.24.self_attn.o_proj": {
|
| 322 |
+
"bits": 8
|
| 323 |
+
},
|
| 324 |
+
"model.layers.24.self_attn.q_a_proj": {
|
| 325 |
+
"bits": 8
|
| 326 |
+
},
|
| 327 |
+
"model.layers.24.self_attn.q_b_proj": {
|
| 328 |
+
"bits": 8
|
| 329 |
+
},
|
| 330 |
+
"model.layers.25.self_attn.kv_a_proj_with_mqa": {
|
| 331 |
+
"bits": 8
|
| 332 |
+
},
|
| 333 |
+
"model.layers.25.self_attn.kv_b_proj": {
|
| 334 |
+
"bits": 8
|
| 335 |
+
},
|
| 336 |
+
"model.layers.25.self_attn.o_proj": {
|
| 337 |
+
"bits": 8
|
| 338 |
+
},
|
| 339 |
+
"model.layers.25.self_attn.q_a_proj": {
|
| 340 |
+
"bits": 8
|
| 341 |
+
},
|
| 342 |
+
"model.layers.25.self_attn.q_b_proj": {
|
| 343 |
+
"bits": 8
|
| 344 |
+
},
|
| 345 |
+
"model.layers.26.self_attn.kv_a_proj_with_mqa": {
|
| 346 |
+
"bits": 8
|
| 347 |
+
},
|
| 348 |
+
"model.layers.26.self_attn.kv_b_proj": {
|
| 349 |
+
"bits": 8
|
| 350 |
+
},
|
| 351 |
+
"model.layers.26.self_attn.o_proj": {
|
| 352 |
+
"bits": 8
|
| 353 |
+
},
|
| 354 |
+
"model.layers.26.self_attn.q_a_proj": {
|
| 355 |
+
"bits": 8
|
| 356 |
+
},
|
| 357 |
+
"model.layers.26.self_attn.q_b_proj": {
|
| 358 |
+
"bits": 8
|
| 359 |
+
},
|
| 360 |
+
"model.layers.27.self_attn.kv_a_proj_with_mqa": {
|
| 361 |
+
"bits": 8
|
| 362 |
+
},
|
| 363 |
+
"model.layers.27.self_attn.kv_b_proj": {
|
| 364 |
+
"bits": 8
|
| 365 |
+
},
|
| 366 |
+
"model.layers.27.self_attn.o_proj": {
|
| 367 |
+
"bits": 8
|
| 368 |
+
},
|
| 369 |
+
"model.layers.27.self_attn.q_a_proj": {
|
| 370 |
+
"bits": 8
|
| 371 |
+
},
|
| 372 |
+
"model.layers.27.self_attn.q_b_proj": {
|
| 373 |
+
"bits": 8
|
| 374 |
+
},
|
| 375 |
+
"model.layers.28.self_attn.kv_a_proj_with_mqa": {
|
| 376 |
+
"bits": 8
|
| 377 |
+
},
|
| 378 |
+
"model.layers.28.self_attn.kv_b_proj": {
|
| 379 |
+
"bits": 8
|
| 380 |
+
},
|
| 381 |
+
"model.layers.28.self_attn.o_proj": {
|
| 382 |
+
"bits": 8
|
| 383 |
+
},
|
| 384 |
+
"model.layers.28.self_attn.q_a_proj": {
|
| 385 |
+
"bits": 8
|
| 386 |
+
},
|
| 387 |
+
"model.layers.28.self_attn.q_b_proj": {
|
| 388 |
+
"bits": 8
|
| 389 |
+
},
|
| 390 |
+
"model.layers.29.self_attn.kv_a_proj_with_mqa": {
|
| 391 |
+
"bits": 8
|
| 392 |
+
},
|
| 393 |
+
"model.layers.29.self_attn.kv_b_proj": {
|
| 394 |
+
"bits": 8
|
| 395 |
+
},
|
| 396 |
+
"model.layers.29.self_attn.o_proj": {
|
| 397 |
+
"bits": 8
|
| 398 |
+
},
|
| 399 |
+
"model.layers.29.self_attn.q_a_proj": {
|
| 400 |
+
"bits": 8
|
| 401 |
+
},
|
| 402 |
+
"model.layers.29.self_attn.q_b_proj": {
|
| 403 |
+
"bits": 8
|
| 404 |
+
},
|
| 405 |
+
"model.layers.3.self_attn.kv_a_proj_with_mqa": {
|
| 406 |
+
"bits": 8
|
| 407 |
+
},
|
| 408 |
+
"model.layers.3.self_attn.kv_b_proj": {
|
| 409 |
+
"bits": 8
|
| 410 |
+
},
|
| 411 |
+
"model.layers.3.self_attn.o_proj": {
|
| 412 |
+
"bits": 8
|
| 413 |
+
},
|
| 414 |
+
"model.layers.3.self_attn.q_a_proj": {
|
| 415 |
+
"bits": 8
|
| 416 |
+
},
|
| 417 |
+
"model.layers.3.self_attn.q_b_proj": {
|
| 418 |
+
"bits": 8
|
| 419 |
+
},
|
| 420 |
+
"model.layers.30.self_attn.kv_a_proj_with_mqa": {
|
| 421 |
+
"bits": 8
|
| 422 |
+
},
|
| 423 |
+
"model.layers.30.self_attn.kv_b_proj": {
|
| 424 |
+
"bits": 8
|
| 425 |
+
},
|
| 426 |
+
"model.layers.30.self_attn.o_proj": {
|
| 427 |
+
"bits": 8
|
| 428 |
+
},
|
| 429 |
+
"model.layers.30.self_attn.q_a_proj": {
|
| 430 |
+
"bits": 8
|
| 431 |
+
},
|
| 432 |
+
"model.layers.30.self_attn.q_b_proj": {
|
| 433 |
+
"bits": 8
|
| 434 |
+
},
|
| 435 |
+
"model.layers.31.self_attn.kv_a_proj_with_mqa": {
|
| 436 |
+
"bits": 8
|
| 437 |
+
},
|
| 438 |
+
"model.layers.31.self_attn.kv_b_proj": {
|
| 439 |
+
"bits": 8
|
| 440 |
+
},
|
| 441 |
+
"model.layers.31.self_attn.o_proj": {
|
| 442 |
+
"bits": 8
|
| 443 |
+
},
|
| 444 |
+
"model.layers.31.self_attn.q_a_proj": {
|
| 445 |
+
"bits": 8
|
| 446 |
+
},
|
| 447 |
+
"model.layers.31.self_attn.q_b_proj": {
|
| 448 |
+
"bits": 8
|
| 449 |
+
},
|
| 450 |
+
"model.layers.32.self_attn.kv_a_proj_with_mqa": {
|
| 451 |
+
"bits": 8
|
| 452 |
+
},
|
| 453 |
+
"model.layers.32.self_attn.kv_b_proj": {
|
| 454 |
+
"bits": 8
|
| 455 |
+
},
|
| 456 |
+
"model.layers.32.self_attn.o_proj": {
|
| 457 |
+
"bits": 8
|
| 458 |
+
},
|
| 459 |
+
"model.layers.32.self_attn.q_a_proj": {
|
| 460 |
+
"bits": 8
|
| 461 |
+
},
|
| 462 |
+
"model.layers.32.self_attn.q_b_proj": {
|
| 463 |
+
"bits": 8
|
| 464 |
+
},
|
| 465 |
+
"model.layers.33.self_attn.kv_a_proj_with_mqa": {
|
| 466 |
+
"bits": 8
|
| 467 |
+
},
|
| 468 |
+
"model.layers.33.self_attn.kv_b_proj": {
|
| 469 |
+
"bits": 8
|
| 470 |
+
},
|
| 471 |
+
"model.layers.33.self_attn.o_proj": {
|
| 472 |
+
"bits": 8
|
| 473 |
+
},
|
| 474 |
+
"model.layers.33.self_attn.q_a_proj": {
|
| 475 |
+
"bits": 8
|
| 476 |
+
},
|
| 477 |
+
"model.layers.33.self_attn.q_b_proj": {
|
| 478 |
+
"bits": 8
|
| 479 |
+
},
|
| 480 |
+
"model.layers.34.self_attn.kv_a_proj_with_mqa": {
|
| 481 |
+
"bits": 8
|
| 482 |
+
},
|
| 483 |
+
"model.layers.34.self_attn.kv_b_proj": {
|
| 484 |
+
"bits": 8
|
| 485 |
+
},
|
| 486 |
+
"model.layers.34.self_attn.o_proj": {
|
| 487 |
+
"bits": 8
|
| 488 |
+
},
|
| 489 |
+
"model.layers.34.self_attn.q_a_proj": {
|
| 490 |
+
"bits": 8
|
| 491 |
+
},
|
| 492 |
+
"model.layers.34.self_attn.q_b_proj": {
|
| 493 |
+
"bits": 8
|
| 494 |
+
},
|
| 495 |
+
"model.layers.35.self_attn.kv_a_proj_with_mqa": {
|
| 496 |
+
"bits": 8
|
| 497 |
+
},
|
| 498 |
+
"model.layers.35.self_attn.kv_b_proj": {
|
| 499 |
+
"bits": 8
|
| 500 |
+
},
|
| 501 |
+
"model.layers.35.self_attn.o_proj": {
|
| 502 |
+
"bits": 8
|
| 503 |
+
},
|
| 504 |
+
"model.layers.35.self_attn.q_a_proj": {
|
| 505 |
+
"bits": 8
|
| 506 |
+
},
|
| 507 |
+
"model.layers.35.self_attn.q_b_proj": {
|
| 508 |
+
"bits": 8
|
| 509 |
+
},
|
| 510 |
+
"model.layers.36.self_attn.kv_a_proj_with_mqa": {
|
| 511 |
+
"bits": 8
|
| 512 |
+
},
|
| 513 |
+
"model.layers.36.self_attn.kv_b_proj": {
|
| 514 |
+
"bits": 8
|
| 515 |
+
},
|
| 516 |
+
"model.layers.36.self_attn.o_proj": {
|
| 517 |
+
"bits": 8
|
| 518 |
+
},
|
| 519 |
+
"model.layers.36.self_attn.q_a_proj": {
|
| 520 |
+
"bits": 8
|
| 521 |
+
},
|
| 522 |
+
"model.layers.36.self_attn.q_b_proj": {
|
| 523 |
+
"bits": 8
|
| 524 |
+
},
|
| 525 |
+
"model.layers.37.self_attn.kv_a_proj_with_mqa": {
|
| 526 |
+
"bits": 8
|
| 527 |
+
},
|
| 528 |
+
"model.layers.37.self_attn.kv_b_proj": {
|
| 529 |
+
"bits": 8
|
| 530 |
+
},
|
| 531 |
+
"model.layers.37.self_attn.o_proj": {
|
| 532 |
+
"bits": 8
|
| 533 |
+
},
|
| 534 |
+
"model.layers.37.self_attn.q_a_proj": {
|
| 535 |
+
"bits": 8
|
| 536 |
+
},
|
| 537 |
+
"model.layers.37.self_attn.q_b_proj": {
|
| 538 |
+
"bits": 8
|
| 539 |
+
},
|
| 540 |
+
"model.layers.38.self_attn.kv_a_proj_with_mqa": {
|
| 541 |
+
"bits": 8
|
| 542 |
+
},
|
| 543 |
+
"model.layers.38.self_attn.kv_b_proj": {
|
| 544 |
+
"bits": 8
|
| 545 |
+
},
|
| 546 |
+
"model.layers.38.self_attn.o_proj": {
|
| 547 |
+
"bits": 8
|
| 548 |
+
},
|
| 549 |
+
"model.layers.38.self_attn.q_a_proj": {
|
| 550 |
+
"bits": 8
|
| 551 |
+
},
|
| 552 |
+
"model.layers.38.self_attn.q_b_proj": {
|
| 553 |
+
"bits": 8
|
| 554 |
+
},
|
| 555 |
+
"model.layers.39.self_attn.kv_a_proj_with_mqa": {
|
| 556 |
+
"bits": 8
|
| 557 |
+
},
|
| 558 |
+
"model.layers.39.self_attn.kv_b_proj": {
|
| 559 |
+
"bits": 8
|
| 560 |
+
},
|
| 561 |
+
"model.layers.39.self_attn.o_proj": {
|
| 562 |
+
"bits": 8
|
| 563 |
+
},
|
| 564 |
+
"model.layers.39.self_attn.q_a_proj": {
|
| 565 |
+
"bits": 8
|
| 566 |
+
},
|
| 567 |
+
"model.layers.39.self_attn.q_b_proj": {
|
| 568 |
+
"bits": 8
|
| 569 |
+
},
|
| 570 |
+
"model.layers.4.self_attn.kv_a_proj_with_mqa": {
|
| 571 |
+
"bits": 8
|
| 572 |
+
},
|
| 573 |
+
"model.layers.4.self_attn.kv_b_proj": {
|
| 574 |
+
"bits": 8
|
| 575 |
+
},
|
| 576 |
+
"model.layers.4.self_attn.o_proj": {
|
| 577 |
+
"bits": 8
|
| 578 |
+
},
|
| 579 |
+
"model.layers.4.self_attn.q_a_proj": {
|
| 580 |
+
"bits": 8
|
| 581 |
+
},
|
| 582 |
+
"model.layers.4.self_attn.q_b_proj": {
|
| 583 |
+
"bits": 8
|
| 584 |
+
},
|
| 585 |
+
"model.layers.40.self_attn.kv_a_proj_with_mqa": {
|
| 586 |
+
"bits": 8
|
| 587 |
+
},
|
| 588 |
+
"model.layers.40.self_attn.kv_b_proj": {
|
| 589 |
+
"bits": 8
|
| 590 |
+
},
|
| 591 |
+
"model.layers.40.self_attn.o_proj": {
|
| 592 |
+
"bits": 8
|
| 593 |
+
},
|
| 594 |
+
"model.layers.40.self_attn.q_a_proj": {
|
| 595 |
+
"bits": 8
|
| 596 |
+
},
|
| 597 |
+
"model.layers.40.self_attn.q_b_proj": {
|
| 598 |
+
"bits": 8
|
| 599 |
+
},
|
| 600 |
+
"model.layers.41.self_attn.kv_a_proj_with_mqa": {
|
| 601 |
+
"bits": 8
|
| 602 |
+
},
|
| 603 |
+
"model.layers.41.self_attn.kv_b_proj": {
|
| 604 |
+
"bits": 8
|
| 605 |
+
},
|
| 606 |
+
"model.layers.41.self_attn.o_proj": {
|
| 607 |
+
"bits": 8
|
| 608 |
+
},
|
| 609 |
+
"model.layers.41.self_attn.q_a_proj": {
|
| 610 |
+
"bits": 8
|
| 611 |
+
},
|
| 612 |
+
"model.layers.41.self_attn.q_b_proj": {
|
| 613 |
+
"bits": 8
|
| 614 |
+
},
|
| 615 |
+
"model.layers.42.self_attn.kv_a_proj_with_mqa": {
|
| 616 |
+
"bits": 8
|
| 617 |
+
},
|
| 618 |
+
"model.layers.42.self_attn.kv_b_proj": {
|
| 619 |
+
"bits": 8
|
| 620 |
+
},
|
| 621 |
+
"model.layers.42.self_attn.o_proj": {
|
| 622 |
+
"bits": 8
|
| 623 |
+
},
|
| 624 |
+
"model.layers.42.self_attn.q_a_proj": {
|
| 625 |
+
"bits": 8
|
| 626 |
+
},
|
| 627 |
+
"model.layers.42.self_attn.q_b_proj": {
|
| 628 |
+
"bits": 8
|
| 629 |
+
},
|
| 630 |
+
"model.layers.43.self_attn.kv_a_proj_with_mqa": {
|
| 631 |
+
"bits": 8
|
| 632 |
+
},
|
| 633 |
+
"model.layers.43.self_attn.kv_b_proj": {
|
| 634 |
+
"bits": 8
|
| 635 |
+
},
|
| 636 |
+
"model.layers.43.self_attn.o_proj": {
|
| 637 |
+
"bits": 8
|
| 638 |
+
},
|
| 639 |
+
"model.layers.43.self_attn.q_a_proj": {
|
| 640 |
+
"bits": 8
|
| 641 |
+
},
|
| 642 |
+
"model.layers.43.self_attn.q_b_proj": {
|
| 643 |
+
"bits": 8
|
| 644 |
+
},
|
| 645 |
+
"model.layers.44.self_attn.kv_a_proj_with_mqa": {
|
| 646 |
+
"bits": 8
|
| 647 |
+
},
|
| 648 |
+
"model.layers.44.self_attn.kv_b_proj": {
|
| 649 |
+
"bits": 8
|
| 650 |
+
},
|
| 651 |
+
"model.layers.44.self_attn.o_proj": {
|
| 652 |
+
"bits": 8
|
| 653 |
+
},
|
| 654 |
+
"model.layers.44.self_attn.q_a_proj": {
|
| 655 |
+
"bits": 8
|
| 656 |
+
},
|
| 657 |
+
"model.layers.44.self_attn.q_b_proj": {
|
| 658 |
+
"bits": 8
|
| 659 |
+
},
|
| 660 |
+
"model.layers.45.self_attn.kv_a_proj_with_mqa": {
|
| 661 |
+
"bits": 8
|
| 662 |
+
},
|
| 663 |
+
"model.layers.45.self_attn.kv_b_proj": {
|
| 664 |
+
"bits": 8
|
| 665 |
+
},
|
| 666 |
+
"model.layers.45.self_attn.o_proj": {
|
| 667 |
+
"bits": 8
|
| 668 |
+
},
|
| 669 |
+
"model.layers.45.self_attn.q_a_proj": {
|
| 670 |
+
"bits": 8
|
| 671 |
+
},
|
| 672 |
+
"model.layers.45.self_attn.q_b_proj": {
|
| 673 |
+
"bits": 8
|
| 674 |
+
},
|
| 675 |
+
"model.layers.46.self_attn.kv_a_proj_with_mqa": {
|
| 676 |
+
"bits": 8
|
| 677 |
+
},
|
| 678 |
+
"model.layers.46.self_attn.kv_b_proj": {
|
| 679 |
+
"bits": 8
|
| 680 |
+
},
|
| 681 |
+
"model.layers.46.self_attn.o_proj": {
|
| 682 |
+
"bits": 8
|
| 683 |
+
},
|
| 684 |
+
"model.layers.46.self_attn.q_a_proj": {
|
| 685 |
+
"bits": 8
|
| 686 |
+
},
|
| 687 |
+
"model.layers.46.self_attn.q_b_proj": {
|
| 688 |
+
"bits": 8
|
| 689 |
+
},
|
| 690 |
+
"model.layers.47.self_attn.kv_a_proj_with_mqa": {
|
| 691 |
+
"bits": 8
|
| 692 |
+
},
|
| 693 |
+
"model.layers.47.self_attn.kv_b_proj": {
|
| 694 |
+
"bits": 8
|
| 695 |
+
},
|
| 696 |
+
"model.layers.47.self_attn.o_proj": {
|
| 697 |
+
"bits": 8
|
| 698 |
+
},
|
| 699 |
+
"model.layers.47.self_attn.q_a_proj": {
|
| 700 |
+
"bits": 8
|
| 701 |
+
},
|
| 702 |
+
"model.layers.47.self_attn.q_b_proj": {
|
| 703 |
+
"bits": 8
|
| 704 |
+
},
|
| 705 |
+
"model.layers.48.self_attn.kv_a_proj_with_mqa": {
|
| 706 |
+
"bits": 8
|
| 707 |
+
},
|
| 708 |
+
"model.layers.48.self_attn.kv_b_proj": {
|
| 709 |
+
"bits": 8
|
| 710 |
+
},
|
| 711 |
+
"model.layers.48.self_attn.o_proj": {
|
| 712 |
+
"bits": 8
|
| 713 |
+
},
|
| 714 |
+
"model.layers.48.self_attn.q_a_proj": {
|
| 715 |
+
"bits": 8
|
| 716 |
+
},
|
| 717 |
+
"model.layers.48.self_attn.q_b_proj": {
|
| 718 |
+
"bits": 8
|
| 719 |
+
},
|
| 720 |
+
"model.layers.49.self_attn.kv_a_proj_with_mqa": {
|
| 721 |
+
"bits": 8
|
| 722 |
+
},
|
| 723 |
+
"model.layers.49.self_attn.kv_b_proj": {
|
| 724 |
+
"bits": 8
|
| 725 |
+
},
|
| 726 |
+
"model.layers.49.self_attn.o_proj": {
|
| 727 |
+
"bits": 8
|
| 728 |
+
},
|
| 729 |
+
"model.layers.49.self_attn.q_a_proj": {
|
| 730 |
+
"bits": 8
|
| 731 |
+
},
|
| 732 |
+
"model.layers.49.self_attn.q_b_proj": {
|
| 733 |
+
"bits": 8
|
| 734 |
+
},
|
| 735 |
+
"model.layers.5.self_attn.kv_a_proj_with_mqa": {
|
| 736 |
+
"bits": 8
|
| 737 |
+
},
|
| 738 |
+
"model.layers.5.self_attn.kv_b_proj": {
|
| 739 |
+
"bits": 8
|
| 740 |
+
},
|
| 741 |
+
"model.layers.5.self_attn.o_proj": {
|
| 742 |
+
"bits": 8
|
| 743 |
+
},
|
| 744 |
+
"model.layers.5.self_attn.q_a_proj": {
|
| 745 |
+
"bits": 8
|
| 746 |
+
},
|
| 747 |
+
"model.layers.5.self_attn.q_b_proj": {
|
| 748 |
+
"bits": 8
|
| 749 |
+
},
|
| 750 |
+
"model.layers.50.self_attn.kv_a_proj_with_mqa": {
|
| 751 |
+
"bits": 8
|
| 752 |
+
},
|
| 753 |
+
"model.layers.50.self_attn.kv_b_proj": {
|
| 754 |
+
"bits": 8
|
| 755 |
+
},
|
| 756 |
+
"model.layers.50.self_attn.o_proj": {
|
| 757 |
+
"bits": 8
|
| 758 |
+
},
|
| 759 |
+
"model.layers.50.self_attn.q_a_proj": {
|
| 760 |
+
"bits": 8
|
| 761 |
+
},
|
| 762 |
+
"model.layers.50.self_attn.q_b_proj": {
|
| 763 |
+
"bits": 8
|
| 764 |
+
},
|
| 765 |
+
"model.layers.51.self_attn.kv_a_proj_with_mqa": {
|
| 766 |
+
"bits": 8
|
| 767 |
+
},
|
| 768 |
+
"model.layers.51.self_attn.kv_b_proj": {
|
| 769 |
+
"bits": 8
|
| 770 |
+
},
|
| 771 |
+
"model.layers.51.self_attn.o_proj": {
|
| 772 |
+
"bits": 8
|
| 773 |
+
},
|
| 774 |
+
"model.layers.51.self_attn.q_a_proj": {
|
| 775 |
+
"bits": 8
|
| 776 |
+
},
|
| 777 |
+
"model.layers.51.self_attn.q_b_proj": {
|
| 778 |
+
"bits": 8
|
| 779 |
+
},
|
| 780 |
+
"model.layers.52.self_attn.kv_a_proj_with_mqa": {
|
| 781 |
+
"bits": 8
|
| 782 |
+
},
|
| 783 |
+
"model.layers.52.self_attn.kv_b_proj": {
|
| 784 |
+
"bits": 8
|
| 785 |
+
},
|
| 786 |
+
"model.layers.52.self_attn.o_proj": {
|
| 787 |
+
"bits": 8
|
| 788 |
+
},
|
| 789 |
+
"model.layers.52.self_attn.q_a_proj": {
|
| 790 |
+
"bits": 8
|
| 791 |
+
},
|
| 792 |
+
"model.layers.52.self_attn.q_b_proj": {
|
| 793 |
+
"bits": 8
|
| 794 |
+
},
|
| 795 |
+
"model.layers.53.self_attn.kv_a_proj_with_mqa": {
|
| 796 |
+
"bits": 8
|
| 797 |
+
},
|
| 798 |
+
"model.layers.53.self_attn.kv_b_proj": {
|
| 799 |
+
"bits": 8
|
| 800 |
+
},
|
| 801 |
+
"model.layers.53.self_attn.o_proj": {
|
| 802 |
+
"bits": 8
|
| 803 |
+
},
|
| 804 |
+
"model.layers.53.self_attn.q_a_proj": {
|
| 805 |
+
"bits": 8
|
| 806 |
+
},
|
| 807 |
+
"model.layers.53.self_attn.q_b_proj": {
|
| 808 |
+
"bits": 8
|
| 809 |
+
},
|
| 810 |
+
"model.layers.54.self_attn.kv_a_proj_with_mqa": {
|
| 811 |
+
"bits": 8
|
| 812 |
+
},
|
| 813 |
+
"model.layers.54.self_attn.kv_b_proj": {
|
| 814 |
+
"bits": 8
|
| 815 |
+
},
|
| 816 |
+
"model.layers.54.self_attn.o_proj": {
|
| 817 |
+
"bits": 8
|
| 818 |
+
},
|
| 819 |
+
"model.layers.54.self_attn.q_a_proj": {
|
| 820 |
+
"bits": 8
|
| 821 |
+
},
|
| 822 |
+
"model.layers.54.self_attn.q_b_proj": {
|
| 823 |
+
"bits": 8
|
| 824 |
+
},
|
| 825 |
+
"model.layers.55.self_attn.kv_a_proj_with_mqa": {
|
| 826 |
+
"bits": 8
|
| 827 |
+
},
|
| 828 |
+
"model.layers.55.self_attn.kv_b_proj": {
|
| 829 |
+
"bits": 8
|
| 830 |
+
},
|
| 831 |
+
"model.layers.55.self_attn.o_proj": {
|
| 832 |
+
"bits": 8
|
| 833 |
+
},
|
| 834 |
+
"model.layers.55.self_attn.q_a_proj": {
|
| 835 |
+
"bits": 8
|
| 836 |
+
},
|
| 837 |
+
"model.layers.55.self_attn.q_b_proj": {
|
| 838 |
+
"bits": 8
|
| 839 |
+
},
|
| 840 |
+
"model.layers.56.self_attn.kv_a_proj_with_mqa": {
|
| 841 |
+
"bits": 8
|
| 842 |
+
},
|
| 843 |
+
"model.layers.56.self_attn.kv_b_proj": {
|
| 844 |
+
"bits": 8
|
| 845 |
+
},
|
| 846 |
+
"model.layers.56.self_attn.o_proj": {
|
| 847 |
+
"bits": 8
|
| 848 |
+
},
|
| 849 |
+
"model.layers.56.self_attn.q_a_proj": {
|
| 850 |
+
"bits": 8
|
| 851 |
+
},
|
| 852 |
+
"model.layers.56.self_attn.q_b_proj": {
|
| 853 |
+
"bits": 8
|
| 854 |
+
},
|
| 855 |
+
"model.layers.57.self_attn.kv_a_proj_with_mqa": {
|
| 856 |
+
"bits": 8
|
| 857 |
+
},
|
| 858 |
+
"model.layers.57.self_attn.kv_b_proj": {
|
| 859 |
+
"bits": 8
|
| 860 |
+
},
|
| 861 |
+
"model.layers.57.self_attn.o_proj": {
|
| 862 |
+
"bits": 8
|
| 863 |
+
},
|
| 864 |
+
"model.layers.57.self_attn.q_a_proj": {
|
| 865 |
+
"bits": 8
|
| 866 |
+
},
|
| 867 |
+
"model.layers.57.self_attn.q_b_proj": {
|
| 868 |
+
"bits": 8
|
| 869 |
+
},
|
| 870 |
+
"model.layers.58.self_attn.kv_a_proj_with_mqa": {
|
| 871 |
+
"bits": 8
|
| 872 |
+
},
|
| 873 |
+
"model.layers.58.self_attn.kv_b_proj": {
|
| 874 |
+
"bits": 8
|
| 875 |
+
},
|
| 876 |
+
"model.layers.58.self_attn.o_proj": {
|
| 877 |
+
"bits": 8
|
| 878 |
+
},
|
| 879 |
+
"model.layers.58.self_attn.q_a_proj": {
|
| 880 |
+
"bits": 8
|
| 881 |
+
},
|
| 882 |
+
"model.layers.58.self_attn.q_b_proj": {
|
| 883 |
+
"bits": 8
|
| 884 |
+
},
|
| 885 |
+
"model.layers.59.self_attn.kv_a_proj_with_mqa": {
|
| 886 |
+
"bits": 8
|
| 887 |
+
},
|
| 888 |
+
"model.layers.59.self_attn.kv_b_proj": {
|
| 889 |
+
"bits": 8
|
| 890 |
+
},
|
| 891 |
+
"model.layers.59.self_attn.o_proj": {
|
| 892 |
+
"bits": 8
|
| 893 |
+
},
|
| 894 |
+
"model.layers.59.self_attn.q_a_proj": {
|
| 895 |
+
"bits": 8
|
| 896 |
+
},
|
| 897 |
+
"model.layers.59.self_attn.q_b_proj": {
|
| 898 |
+
"bits": 8
|
| 899 |
+
},
|
| 900 |
+
"model.layers.6.self_attn.kv_a_proj_with_mqa": {
|
| 901 |
+
"bits": 8
|
| 902 |
+
},
|
| 903 |
+
"model.layers.6.self_attn.kv_b_proj": {
|
| 904 |
+
"bits": 8
|
| 905 |
+
},
|
| 906 |
+
"model.layers.6.self_attn.o_proj": {
|
| 907 |
+
"bits": 8
|
| 908 |
+
},
|
| 909 |
+
"model.layers.6.self_attn.q_a_proj": {
|
| 910 |
+
"bits": 8
|
| 911 |
+
},
|
| 912 |
+
"model.layers.6.self_attn.q_b_proj": {
|
| 913 |
+
"bits": 8
|
| 914 |
+
},
|
| 915 |
+
"model.layers.60.self_attn.kv_a_proj_with_mqa": {
|
| 916 |
+
"bits": 8
|
| 917 |
+
},
|
| 918 |
+
"model.layers.60.self_attn.kv_b_proj": {
|
| 919 |
+
"bits": 8
|
| 920 |
+
},
|
| 921 |
+
"model.layers.60.self_attn.o_proj": {
|
| 922 |
+
"bits": 8
|
| 923 |
+
},
|
| 924 |
+
"model.layers.60.self_attn.q_a_proj": {
|
| 925 |
+
"bits": 8
|
| 926 |
+
},
|
| 927 |
+
"model.layers.60.self_attn.q_b_proj": {
|
| 928 |
+
"bits": 8
|
| 929 |
+
},
|
| 930 |
+
"model.layers.7.self_attn.kv_a_proj_with_mqa": {
|
| 931 |
+
"bits": 8
|
| 932 |
+
},
|
| 933 |
+
"model.layers.7.self_attn.kv_b_proj": {
|
| 934 |
+
"bits": 8
|
| 935 |
+
},
|
| 936 |
+
"model.layers.7.self_attn.o_proj": {
|
| 937 |
+
"bits": 8
|
| 938 |
+
},
|
| 939 |
+
"model.layers.7.self_attn.q_a_proj": {
|
| 940 |
+
"bits": 8
|
| 941 |
+
},
|
| 942 |
+
"model.layers.7.self_attn.q_b_proj": {
|
| 943 |
+
"bits": 8
|
| 944 |
+
},
|
| 945 |
+
"model.layers.8.self_attn.kv_a_proj_with_mqa": {
|
| 946 |
+
"bits": 8
|
| 947 |
+
},
|
| 948 |
+
"model.layers.8.self_attn.kv_b_proj": {
|
| 949 |
+
"bits": 8
|
| 950 |
+
},
|
| 951 |
+
"model.layers.8.self_attn.o_proj": {
|
| 952 |
+
"bits": 8
|
| 953 |
+
},
|
| 954 |
+
"model.layers.8.self_attn.q_a_proj": {
|
| 955 |
+
"bits": 8
|
| 956 |
+
},
|
| 957 |
+
"model.layers.8.self_attn.q_b_proj": {
|
| 958 |
+
"bits": 8
|
| 959 |
+
},
|
| 960 |
+
"model.layers.9.self_attn.kv_a_proj_with_mqa": {
|
| 961 |
+
"bits": 8
|
| 962 |
+
},
|
| 963 |
+
"model.layers.9.self_attn.kv_b_proj": {
|
| 964 |
+
"bits": 8
|
| 965 |
+
},
|
| 966 |
+
"model.layers.9.self_attn.o_proj": {
|
| 967 |
+
"bits": 8
|
| 968 |
+
},
|
| 969 |
+
"model.layers.9.self_attn.q_a_proj": {
|
| 970 |
+
"bits": 8
|
| 971 |
+
},
|
| 972 |
+
"model.layers.9.self_attn.q_b_proj": {
|
| 973 |
+
"bits": 8
|
| 974 |
+
}
|
| 975 |
+
},
|
| 976 |
+
"group_size": 128,
|
| 977 |
+
"iters": 0,
|
| 978 |
+
"low_gpu_mem_usage": true,
|
| 979 |
+
"nsamples": 512,
|
| 980 |
+
"packing_format": "auto_round:auto_gptq",
|
| 981 |
+
"quant_method": "auto-round",
|
| 982 |
+
"sym": true
|
| 983 |
+
},
|
| 984 |
+
"rms_norm_eps": 1e-06,
|
| 985 |
+
"rope_scaling": {
|
| 986 |
+
"beta_fast": 1.0,
|
| 987 |
+
"beta_slow": 1.0,
|
| 988 |
+
"factor": 32.0,
|
| 989 |
+
"mscale": 1.0,
|
| 990 |
+
"mscale_all_dim": 1.0,
|
| 991 |
+
"original_max_position_embeddings": 4096,
|
| 992 |
+
"type": "yarn"
|
| 993 |
+
},
|
| 994 |
+
"rope_theta": 50000.0,
|
| 995 |
+
"routed_scaling_factor": 2.827,
|
| 996 |
+
"scoring_func": "sigmoid",
|
| 997 |
+
"seq_aux": true,
|
| 998 |
+
"tie_word_embeddings": false,
|
| 999 |
+
"topk_group": 1,
|
| 1000 |
+
"topk_method": "noaux_tc",
|
| 1001 |
+
"torch_dtype": "bfloat16",
|
| 1002 |
+
"transformers_version": "4.53.3",
|
| 1003 |
+
"unsloth_fixed": true,
|
| 1004 |
+
"use_cache": true,
|
| 1005 |
+
"v_head_dim": 128,
|
| 1006 |
+
"vocab_size": 163840
|
| 1007 |
+
}
|
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,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"eos_token_id": 163586,
|
| 3 |
+
"max_length": 131072,
|
| 4 |
+
"transformers_version": "4.53.3"
|
| 5 |
+
}
|
model-00001-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8e2f2e9decf730d7f577223608316813688f225e5c40342efa66dcd973382cab
|
| 3 |
+
size 4997928016
|
model-00002-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:784bdb871ec77c2b5e555eff6ae72c6a8dd7fdc327658c6aac0e7cdd4076c6e7
|
| 3 |
+
size 4995762944
|
model-00003-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1af8b1649389201a5cd9cca1a1bc39f85d2c42496e479f2a28a8d38c4f8a5af4
|
| 3 |
+
size 4998015528
|
model-00004-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81d967b77ae89b237bc42e5ee75cc8dbc3551c8cc815e4b074cf7b3eaa980467
|
| 3 |
+
size 4995763040
|
model-00005-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:174c7ccd61d402bf2fb0596b9da2fe7362e018c751aa4cea45932a5115826712
|
| 3 |
+
size 4998015528
|
model-00006-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:83de062885a6560248df7c2fb7d6526841d1c27c8db81eae5a041622282f9915
|
| 3 |
+
size 4998016320
|
model-00007-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1b0f7b676f82c7341e8e8901475a58fe5a3c8a65cd38687347965ae8c898764
|
| 3 |
+
size 4995762248
|
model-00008-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c347b6a4b94cb92d5af49b21dd5c13b707a45fdcc1ac67aa226c39dff2a8fa4
|
| 3 |
+
size 4998015896
|
model-00009-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1181a7a267bd8e3ac500505f371c2fb7e49bbd9bd5105459ff6d71ded53e2f20
|
| 3 |
+
size 4995762672
|
model-00010-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81ea55601e3e352f722bc634e0edda88c58585e8b6f4c967fe0815d51aab6696
|
| 3 |
+
size 4998015528
|
model-00011-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ff8bb0c589400356bf2ae894d1a1dc270bad6dd792c0e5b891d5e711931aafd0
|
| 3 |
+
size 4995763040
|
model-00012-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5d76738720a8943fab87e6b02b9589d8de8f104464a590ff59cef36b078a450b
|
| 3 |
+
size 4998015528
|
model-00013-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d54b80a45a77a5d06ca3260e02a46584b82d85a792165e569d6daef46ff71772
|
| 3 |
+
size 4995763040
|
model-00014-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2c2bdceaee55c4c15a73b1c0b8da8133d17eb3cfb84292ec09fc89587197569
|
| 3 |
+
size 4998015528
|
model-00015-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2eb11977d3083d24d50f3fae5835b5564c592312de47912678a69b3af8d8a008
|
| 3 |
+
size 4998016176
|
model-00016-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b9de90a9e3c547050f67fd4a5eba91c28b907ca67cb894a345531d1846ee354d
|
| 3 |
+
size 4995762392
|
model-00017-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:df46b84f09cb3c126c5016246173500f834398009ee5062caf99969c32129891
|
| 3 |
+
size 4998016448
|
model-00018-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6047ac8cde477c79bacdae8b060e93625e8dadb2d7f15dc57dc6a8ca13aa6ff
|
| 3 |
+
size 4995764776
|
model-00019-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:578896629c78d7ce2675c7a668ef6bcb503f556adc69eefafb95445f93cce8a8
|
| 3 |
+
size 4998017472
|
model-00020-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bbb86c52def97e9a71447dae9e162901c757671c303fd1fcb1e8f974ab86837d
|
| 3 |
+
size 4995765000
|
model-00021-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:84985426f016cc36f2ca6dd3b22889106f52f537ac35dd0314a3cb6f699d788e
|
| 3 |
+
size 4998017472
|
model-00022-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73783c92217aee489cda1258b5635d986cdec4944abec70fef10ee338816eb02
|
| 3 |
+
size 4983684336
|
model-00023-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9c719f2f15b918567a6dbf858ad77bc78139203f49a912999e6e795c377ad0fa
|
| 3 |
+
size 4994843888
|
model-00024-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b93aa68a28da63144706f8d446281b8b2abb58b8d0c12c2e5fa324da03f8df3b
|
| 3 |
+
size 4998017976
|
model-00025-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7f9000686d7ec301877b1298e1433dcb421a0cdd923b6a8a8c3eed0b8376c429
|
| 3 |
+
size 4995764496
|
model-00026-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a12db9346f8f570d4d8f4b5a8efa3e5ed821cf1a3e6f710013c7712e798e2c2
|
| 3 |
+
size 4998017552
|
model-00027-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b93b2633b14a611f76c1db4590e8d6fe6bf836f16c11b7485cd05ebd4087cdba
|
| 3 |
+
size 4995764920
|
model-00028-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19269d2bc9a42fdfa5bd030525da3e6356f705de3450004e359a14efd617d93c
|
| 3 |
+
size 4998017472
|
model-00029-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9651c035771b10b35196aa214cd85d0bbc7d90078a9b69c4a9bbec604170a0d6
|
| 3 |
+
size 4995765000
|
model-00030-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f0af884e47fd3f669a8f89a1e3071ed3b5bd2fa6119e36f7f10fa571b2aa11da
|
| 3 |
+
size 4998017472
|
model-00031-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f58d8df36c17b1223ae811ca172638a4c1d23e3f4bf88d1069a538bf9932c5c1
|
| 3 |
+
size 4998018240
|
model-00032-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f583a6d7ec187a8fc02c2f4b5ffab8db75002ef0578cb33f30aa31658bb5e72
|
| 3 |
+
size 4995764232
|
model-00033-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27adcc81c92107788453f11ac0bdfc7f7884037b017cea6eaeac43ce6d6229a2
|
| 3 |
+
size 4998017816
|
model-00034-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a880e5b2d4c5cd6da9ebc19076138d05c32e89d88330c88823d0581c21228395
|
| 3 |
+
size 4995764656
|
model-00035-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20451a195aa976054f04836f1a0508f2c2033d0b1ba7b0a581a54d8eccfdc0fb
|
| 3 |
+
size 4998017472
|
model-00036-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6dd78eb8ee7a2cd4e8c68987fa75b02ee4ed53fe45ac683ad22e38039e37f47a
|
| 3 |
+
size 4995765008
|
model-00037-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6d1ff442627382551f7a2d1cd3ac4aa39a24336785dc8ec4c0921bfe41939919
|
| 3 |
+
size 4998017472
|
model-00038-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:28b8ced84b01f25b4ea51e68b41a8ef8f26012d0617b11c7a7ae13ddcaf3651a
|
| 3 |
+
size 4995765008
|
model-00039-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c742a1f4369a605d8604f6285557ac2e9cb41857aca4ae01a55a2a49df80fb2
|
| 3 |
+
size 4998017472
|
model-00040-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:77291932e03746a49c30bab77a0d017afc1c285ffe1d17c7b1295ce73ad1bc7c
|
| 3 |
+
size 4998018096
|
model-00041-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88569b75b8cb9a8ecb70373ef65bfe15b34b1f9c5cb20f3d7ddf5377472856b0
|
| 3 |
+
size 4995764384
|
model-00042-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c1d04abcf28b60023851f43130b77427233caf649410ba35691029213e5bafa4
|
| 3 |
+
size 4998017672
|
model-00043-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:466e5fb838367c0fa62c5c7df52e4c66692e80874f2ed4e957e68e008a3f8511
|
| 3 |
+
size 4995764808
|
model-00044-of-00108.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4ecee5e106328ab7f1a3c4bbfa3ce746e45ef4468c3d805a23d56f4610b15d20
|
| 3 |
+
size 4998017472
|