初始化项目,由ModelHub XC社区提供模型

Model: rita-cohere/iolai-DeepSeek-R1-Distill-Qwen-7B
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-08-18 21:05:23 +08:00
commit bd8a8b9e20
12 changed files with 304378 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -0,0 +1,36 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
figures/benchmark.jpg filter=lfs diff=lfs merge=lfs -text

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 DeepSeek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

239
README.md Normal file
View File

@@ -0,0 +1,239 @@
---
license: mit
library_name: transformers
---
# DeepSeek-R1
<!-- markdownlint-disable first-line-h1 -->
<!-- markdownlint-disable html -->
<!-- markdownlint-disable no-duplicate-header -->
<div align="center">
<img src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/logo.svg?raw=true" width="60%" alt="DeepSeek-V3" />
</div>
<hr>
<div align="center" style="line-height: 1;">
<a href="https://www.deepseek.com/" target="_blank" style="margin: 2px;">
<img alt="Homepage" src="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/badge.svg?raw=true" style="display: inline-block; vertical-align: middle;"/>
</a>
<a href="https://chat.deepseek.com/" target="_blank" style="margin: 2px;">
<img alt="Chat" src="https://img.shields.io/badge/🤖%20Chat-DeepSeek%20R1-536af5?color=536af5&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
</a>
<a href="https://huggingface.co/deepseek-ai" target="_blank" style="margin: 2px;">
<img alt="Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-DeepSeek%20AI-ffc107?color=ffc107&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
</a>
</div>
<div align="center" style="line-height: 1;">
<a href="https://discord.gg/Tc7c45Zzu5" target="_blank" style="margin: 2px;">
<img alt="Discord" src="https://img.shields.io/badge/Discord-DeepSeek%20AI-7289da?logo=discord&logoColor=white&color=7289da" style="display: inline-block; vertical-align: middle;"/>
</a>
<a href="https://github.com/deepseek-ai/DeepSeek-V2/blob/main/figures/qr.jpeg?raw=true" target="_blank" style="margin: 2px;">
<img alt="Wechat" src="https://img.shields.io/badge/WeChat-DeepSeek%20AI-brightgreen?logo=wechat&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
</a>
<a href="https://twitter.com/deepseek_ai" target="_blank" style="margin: 2px;">
<img alt="Twitter Follow" src="https://img.shields.io/badge/Twitter-deepseek_ai-white?logo=x&logoColor=white" style="display: inline-block; vertical-align: middle;"/>
</a>
</div>
<div align="center" style="line-height: 1;">
<a href="https://github.com/deepseek-ai/DeepSeek-R1/blob/main/LICENSE" style="margin: 2px;">
<img alt="License" src="https://img.shields.io/badge/License-MIT-f5de53?&color=f5de53" style="display: inline-block; vertical-align: middle;"/>
</a>
</div>
<p align="center">
<a href="https://github.com/deepseek-ai/DeepSeek-R1/blob/main/DeepSeek_R1.pdf"><b>Paper Link</b>👁️</a>
</p>
## 1. Introduction
We introduce our first-generation reasoning models, DeepSeek-R1-Zero and DeepSeek-R1.
DeepSeek-R1-Zero, a model trained via large-scale reinforcement learning (RL) without supervised fine-tuning (SFT) as a preliminary step, demonstrated remarkable performance on reasoning.
With RL, DeepSeek-R1-Zero naturally emerged with numerous powerful and interesting reasoning behaviors.
However, DeepSeek-R1-Zero encounters challenges such as endless repetition, poor readability, and language mixing. To address these issues and further enhance reasoning performance,
we introduce DeepSeek-R1, which incorporates cold-start data before RL.
DeepSeek-R1 achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks.
To support the research community, we have open-sourced DeepSeek-R1-Zero, DeepSeek-R1, and six dense models distilled from DeepSeek-R1 based on Llama and Qwen. DeepSeek-R1-Distill-Qwen-32B outperforms OpenAI-o1-mini across various benchmarks, achieving new state-of-the-art results for dense models.
**NOTE: Before running DeepSeek-R1 series models locally, we kindly recommend reviewing the [Usage Recommendation](#usage-recommendations) section.**
<p align="center">
<img width="80%" src="figures/benchmark.jpg">
</p>
## 2. Model Summary
---
**Post-Training: Large-Scale Reinforcement Learning on the Base Model**
- We directly apply reinforcement learning (RL) to the base model without relying on supervised fine-tuning (SFT) as a preliminary step. This approach allows the model to explore chain-of-thought (CoT) for solving complex problems, resulting in the development of DeepSeek-R1-Zero. DeepSeek-R1-Zero demonstrates capabilities such as self-verification, reflection, and generating long CoTs, marking a significant milestone for the research community. Notably, it is the first open research to validate that reasoning capabilities of LLMs can be incentivized purely through RL, without the need for SFT. This breakthrough paves the way for future advancements in this area.
- We introduce our pipeline to develop DeepSeek-R1. The pipeline incorporates two RL stages aimed at discovering improved reasoning patterns and aligning with human preferences, as well as two SFT stages that serve as the seed for the model's reasoning and non-reasoning capabilities.
We believe the pipeline will benefit the industry by creating better models.
---
**Distillation: Smaller Models Can Be Powerful Too**
- We demonstrate that the reasoning patterns of larger models can be distilled into smaller models, resulting in better performance compared to the reasoning patterns discovered through RL on small models. The open source DeepSeek-R1, as well as its API, will benefit the research community to distill better smaller models in the future.
- Using the reasoning data generated by DeepSeek-R1, we fine-tuned several dense models that are widely used in the research community. The evaluation results demonstrate that the distilled smaller dense models perform exceptionally well on benchmarks. We open-source distilled 1.5B, 7B, 8B, 14B, 32B, and 70B checkpoints based on Qwen2.5 and Llama3 series to the community.
## 3. Model Downloads
### DeepSeek-R1 Models
<div align="center">
| **Model** | **#Total Params** | **#Activated Params** | **Context Length** | **Download** |
| :------------: | :------------: | :------------: | :------------: | :------------: |
| DeepSeek-R1-Zero | 671B | 37B | 128K | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Zero) |
| DeepSeek-R1 | 671B | 37B | 128K | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1) |
</div>
DeepSeek-R1-Zero & DeepSeek-R1 are trained based on DeepSeek-V3-Base.
For more details regarding the model architecture, please refer to [DeepSeek-V3](https://github.com/deepseek-ai/DeepSeek-V3) repository.
### DeepSeek-R1-Distill Models
<div align="center">
| **Model** | **Base Model** | **Download** |
| :------------: | :------------: | :------------: |
| DeepSeek-R1-Distill-Qwen-1.5B | [Qwen2.5-Math-1.5B](https://huggingface.co/Qwen/Qwen2.5-Math-1.5B) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B) |
| DeepSeek-R1-Distill-Qwen-7B | [Qwen2.5-Math-7B](https://huggingface.co/Qwen/Qwen2.5-Math-7B) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B) |
| DeepSeek-R1-Distill-Llama-8B | [Llama-3.1-8B](https://huggingface.co/meta-llama/Llama-3.1-8B) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B) |
| DeepSeek-R1-Distill-Qwen-14B | [Qwen2.5-14B](https://huggingface.co/Qwen/Qwen2.5-14B) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B) |
|DeepSeek-R1-Distill-Qwen-32B | [Qwen2.5-32B](https://huggingface.co/Qwen/Qwen2.5-32B) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B) |
| DeepSeek-R1-Distill-Llama-70B | [Llama-3.3-70B-Instruct](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct) | [🤗 HuggingFace](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-70B) |
</div>
DeepSeek-R1-Distill models are fine-tuned based on open-source models, using samples generated by DeepSeek-R1.
We slightly change their configs and tokenizers. Please use our setting to run these models.
## 4. Evaluation Results
### DeepSeek-R1-Evaluation
For all our models, the maximum generation length is set to 32,768 tokens. For benchmarks requiring sampling, we use a temperature of $0.6$, a top-p value of $0.95$, and generate 64 responses per query to estimate pass@1.
<div align="center">
| Category | Benchmark (Metric) | Claude-3.5-Sonnet-1022 | GPT-4o 0513 | DeepSeek V3 | OpenAI o1-mini | OpenAI o1-1217 | DeepSeek R1 |
|----------|-------------------|----------------------|------------|--------------|----------------|------------|--------------|
| | Architecture | - | - | MoE | - | - | MoE |
| | # Activated Params | - | - | 37B | - | - | 37B |
| | # Total Params | - | - | 671B | - | - | 671B |
| English | MMLU (Pass@1) | 88.3 | 87.2 | 88.5 | 85.2 | **91.8** | 90.8 |
| | MMLU-Redux (EM) | 88.9 | 88.0 | 89.1 | 86.7 | - | **92.9** |
| | MMLU-Pro (EM) | 78.0 | 72.6 | 75.9 | 80.3 | - | **84.0** |
| | DROP (3-shot F1) | 88.3 | 83.7 | 91.6 | 83.9 | 90.2 | **92.2** |
| | IF-Eval (Prompt Strict) | **86.5** | 84.3 | 86.1 | 84.8 | - | 83.3 |
| | GPQA-Diamond (Pass@1) | 65.0 | 49.9 | 59.1 | 60.0 | **75.7** | 71.5 |
| | SimpleQA (Correct) | 28.4 | 38.2 | 24.9 | 7.0 | **47.0** | 30.1 |
| | FRAMES (Acc.) | 72.5 | 80.5 | 73.3 | 76.9 | - | **82.5** |
| | AlpacaEval2.0 (LC-winrate) | 52.0 | 51.1 | 70.0 | 57.8 | - | **87.6** |
| | ArenaHard (GPT-4-1106) | 85.2 | 80.4 | 85.5 | 92.0 | - | **92.3** |
| Code | LiveCodeBench (Pass@1-COT) | 33.8 | 34.2 | - | 53.8 | 63.4 | **65.9** |
| | Codeforces (Percentile) | 20.3 | 23.6 | 58.7 | 93.4 | **96.6** | 96.3 |
| | Codeforces (Rating) | 717 | 759 | 1134 | 1820 | **2061** | 2029 |
| | SWE Verified (Resolved) | **50.8** | 38.8 | 42.0 | 41.6 | 48.9 | 49.2 |
| | Aider-Polyglot (Acc.) | 45.3 | 16.0 | 49.6 | 32.9 | **61.7** | 53.3 |
| Math | AIME 2024 (Pass@1) | 16.0 | 9.3 | 39.2 | 63.6 | 79.2 | **79.8** |
| | MATH-500 (Pass@1) | 78.3 | 74.6 | 90.2 | 90.0 | 96.4 | **97.3** |
| | CNMO 2024 (Pass@1) | 13.1 | 10.8 | 43.2 | 67.6 | - | **78.8** |
| Chinese | CLUEWSC (EM) | 85.4 | 87.9 | 90.9 | 89.9 | - | **92.8** |
| | C-Eval (EM) | 76.7 | 76.0 | 86.5 | 68.9 | - | **91.8** |
| | C-SimpleQA (Correct) | 55.4 | 58.7 | **68.0** | 40.3 | - | 63.7 |
</div>
### Distilled Model Evaluation
<div align="center">
| Model | AIME 2024 pass@1 | AIME 2024 cons@64 | MATH-500 pass@1 | GPQA Diamond pass@1 | LiveCodeBench pass@1 | CodeForces rating |
|------------------------------------------|------------------|-------------------|-----------------|----------------------|----------------------|-------------------|
| GPT-4o-0513 | 9.3 | 13.4 | 74.6 | 49.9 | 32.9 | 759 |
| Claude-3.5-Sonnet-1022 | 16.0 | 26.7 | 78.3 | 65.0 | 38.9 | 717 |
| o1-mini | 63.6 | 80.0 | 90.0 | 60.0 | 53.8 | **1820** |
| QwQ-32B-Preview | 44.0 | 60.0 | 90.6 | 54.5 | 41.9 | 1316 |
| DeepSeek-R1-Distill-Qwen-1.5B | 28.9 | 52.7 | 83.9 | 33.8 | 16.9 | 954 |
| DeepSeek-R1-Distill-Qwen-7B | 55.5 | 83.3 | 92.8 | 49.1 | 37.6 | 1189 |
| DeepSeek-R1-Distill-Qwen-14B | 69.7 | 80.0 | 93.9 | 59.1 | 53.1 | 1481 |
| DeepSeek-R1-Distill-Qwen-32B | **72.6** | 83.3 | 94.3 | 62.1 | 57.2 | 1691 |
| DeepSeek-R1-Distill-Llama-8B | 50.4 | 80.0 | 89.1 | 49.0 | 39.6 | 1205 |
| DeepSeek-R1-Distill-Llama-70B | 70.0 | **86.7** | **94.5** | **65.2** | **57.5** | 1633 |
</div>
## 5. Chat Website & API Platform
You can chat with DeepSeek-R1 on DeepSeek's official website: [chat.deepseek.com](https://chat.deepseek.com), and switch on the button "DeepThink"
We also provide OpenAI-Compatible API at DeepSeek Platform: [platform.deepseek.com](https://platform.deepseek.com/)
## 6. How to Run Locally
### DeepSeek-R1 Models
Please visit [DeepSeek-V3](https://github.com/deepseek-ai/DeepSeek-V3) repo for more information about running DeepSeek-R1 locally.
**NOTE: Hugging Face's Transformers has not been directly supported yet.**
### DeepSeek-R1-Distill Models
DeepSeek-R1-Distill models can be utilized in the same manner as Qwen or Llama models.
For instance, you can easily start a service using [vLLM](https://github.com/vllm-project/vllm):
```shell
vllm serve deepseek-ai/DeepSeek-R1-Distill-Qwen-32B --tensor-parallel-size 2 --max-model-len 32768 --enforce-eager
```
You can also easily start a service using [SGLang](https://github.com/sgl-project/sglang)
```bash
python3 -m sglang.launch_server --model deepseek-ai/DeepSeek-R1-Distill-Qwen-32B --trust-remote-code --tp 2
```
### Usage Recommendations
**We recommend adhering to the following configurations when utilizing the DeepSeek-R1 series models, including benchmarking, to achieve the expected performance:**
1. Set the temperature within the range of 0.5-0.7 (0.6 is recommended) to prevent endless repetitions or incoherent outputs.
2. **Avoid adding a system prompt; all instructions should be contained within the user prompt.**
3. For mathematical problems, it is advisable to include a directive in your prompt such as: "Please reason step by step, and put your final answer within \boxed{}."
4. When evaluating model performance, it is recommended to conduct multiple tests and average the results.
Additionally, we have observed that the DeepSeek-R1 series models tend to bypass thinking pattern (i.e., outputting "\<think\>\n\n\</think\>") when responding to certain queries, which can adversely affect the model's performance.
**To ensure that the model engages in thorough reasoning, we recommend enforcing the model to initiate its response with "\<think\>\n" at the beginning of every output.**
## 7. License
This code repository and the model weights are licensed under the [MIT License](https://github.com/deepseek-ai/DeepSeek-R1/blob/main/LICENSE).
DeepSeek-R1 series support commercial use, allow for any modifications and derivative works, including, but not limited to, distillation for training other LLMs. Please note that:
- DeepSeek-R1-Distill-Qwen-1.5B, DeepSeek-R1-Distill-Qwen-7B, DeepSeek-R1-Distill-Qwen-14B and DeepSeek-R1-Distill-Qwen-32B are derived from [Qwen-2.5 series](https://github.com/QwenLM/Qwen2.5), which are originally licensed under [Apache 2.0 License](https://huggingface.co/Qwen/Qwen2.5-1.5B/blob/main/LICENSE), and now finetuned with 800k samples curated with DeepSeek-R1.
- DeepSeek-R1-Distill-Llama-8B is derived from Llama3.1-8B-Base and is originally licensed under [llama3.1 license](https://huggingface.co/meta-llama/Llama-3.1-8B/blob/main/LICENSE).
- DeepSeek-R1-Distill-Llama-70B is derived from Llama3.3-70B-Instruct and is originally licensed under [llama3.3 license](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct/blob/main/LICENSE).
## 8. Citation
```
@misc{deepseekai2025deepseekr1incentivizingreasoningcapability,
title={DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning},
author={DeepSeek-AI},
year={2025},
eprint={2501.12948},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2501.12948},
}
```
## 9. Contact
If you have any questions, please raise an issue or contact us at [service@deepseek.com](service@deepseek.com).

28
config.json Normal file
View File

@@ -0,0 +1,28 @@
{
"architectures": [
"Qwen2ForCausalLM"
],
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151643,
"hidden_act": "silu",
"hidden_size": 3584,
"initializer_range": 0.02,
"intermediate_size": 18944,
"max_position_embeddings": 131072,
"max_window_layers": 28,
"model_type": "qwen2",
"num_attention_heads": 28,
"num_hidden_layers": 28,
"num_key_value_heads": 4,
"rms_norm_eps": 1e-06,
"rope_theta": 10000,
"sliding_window": 4096,
"tie_word_embeddings": false,
"torch_dtype": "bfloat16",
"transformers_version": "4.44.0",
"use_cache": true,
"use_mrope": false,
"use_sliding_window": false,
"vocab_size": 152064
}

3
figures/benchmark.jpg Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:96fa3297b31b53a21a283886d9f6d5759433e7523bd63b09d5ac43e9422dae97
size 777314

9
generation_config.json Normal file
View File

@@ -0,0 +1,9 @@
{
"_from_model_config": true,
"bos_token_id": 151646,
"eos_token_id": 151643,
"do_sample": true,
"temperature": 0.6,
"top_p": 0.95,
"transformers_version": "4.39.3"
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8b27be8d43b81d0cd19b3113ef88caf1a61c2fc602de77e3cce97aedcec184b4
size 8606596466

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1780a9502f56f592cb4d6262c8c76ca8ad36a86b0257e052c672d87f49707e80
size 6624675384

View File

@@ -0,0 +1,346 @@
{
"metadata": {
"total_size": 15231233024
},
"weight_map": {
"model.embed_tokens.weight": "model-00001-of-000002.safetensors",
"model.layers.0.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.0.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.0.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.0.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.0.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.0.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.1.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.1.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.1.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.1.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.1.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.1.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.2.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.2.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.2.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.2.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.2.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.2.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.2.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.3.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.3.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.3.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.3.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.3.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.3.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.3.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.4.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.4.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.4.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.4.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.4.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.4.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.5.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.5.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.5.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.5.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.5.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.5.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.5.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.6.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.6.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.6.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.6.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.6.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.6.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.6.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.7.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.7.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.7.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.7.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.7.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.7.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.7.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.7.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.7.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.7.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.7.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.8.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.8.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.8.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.8.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.8.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.8.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.8.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.8.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.8.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.8.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.8.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.8.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.9.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.9.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.9.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.9.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.9.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.9.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.9.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.9.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.9.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.9.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.9.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.9.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.10.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.10.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.10.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.10.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.10.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.10.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.10.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.10.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.10.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.10.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.10.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.10.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.11.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.11.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.11.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.11.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.11.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.11.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.11.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.11.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.11.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.11.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.11.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.11.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.12.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.12.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.12.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.12.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.12.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.12.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.12.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.12.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.12.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.12.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.12.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.12.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.13.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.13.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.13.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.13.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.13.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.13.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.13.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.13.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.13.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.13.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.13.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.13.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.14.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.14.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.14.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.14.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.14.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.14.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.14.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.14.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.14.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.14.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.14.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.14.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.15.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.15.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.15.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.15.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.15.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.15.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.15.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.15.mlp.gate_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.15.mlp.up_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.15.mlp.down_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.15.input_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.15.post_attention_layernorm.weight": "model-00001-of-000002.safetensors",
"model.layers.16.self_attn.q_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.16.self_attn.k_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.16.self_attn.v_proj.bias": "model-00001-of-000002.safetensors",
"model.layers.16.self_attn.q_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.16.self_attn.k_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.16.self_attn.v_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.16.self_attn.o_proj.weight": "model-00001-of-000002.safetensors",
"model.layers.16.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.16.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.16.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.16.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.16.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.17.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.17.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.17.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.17.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.17.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.17.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.17.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.17.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.17.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.17.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.17.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.17.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.18.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.18.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.18.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.18.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.18.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.18.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.18.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.18.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.18.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.18.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.18.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.18.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.19.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.19.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.19.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.19.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.19.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.19.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.19.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.19.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.19.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.19.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.19.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.19.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.20.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.20.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.20.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.20.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.20.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.20.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.20.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.20.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.20.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.20.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.20.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.20.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.21.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.21.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.21.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.21.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.21.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.21.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.21.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.21.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.21.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.21.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.21.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.21.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.22.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.22.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.22.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.22.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.22.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.22.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.22.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.22.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.22.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.22.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.22.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.22.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.23.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.23.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.23.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.23.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.23.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.23.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.23.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.23.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.23.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.23.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.23.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.23.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.24.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.24.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.24.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.24.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.24.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.24.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.24.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.24.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.24.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.24.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.24.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.24.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.25.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.25.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.25.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.25.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.25.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.25.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.25.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.25.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.25.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.25.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.25.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.25.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.26.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.26.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.26.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.26.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.26.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.26.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.26.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.26.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.26.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.26.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.26.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.26.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.27.self_attn.q_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.27.self_attn.k_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.27.self_attn.v_proj.bias": "model-00002-of-000002.safetensors",
"model.layers.27.self_attn.q_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.27.self_attn.k_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.27.self_attn.v_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.27.self_attn.o_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.27.mlp.gate_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.27.mlp.up_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.27.mlp.down_proj.weight": "model-00002-of-000002.safetensors",
"model.layers.27.input_layernorm.weight": "model-00002-of-000002.safetensors",
"model.layers.27.post_attention_layernorm.weight": "model-00002-of-000002.safetensors",
"model.norm.weight": "model-00002-of-000002.safetensors",
"lm_head.weight": "model-00002-of-000002.safetensors"
}
}

373
script.py Normal file
View File

@@ -0,0 +1,373 @@
"""IOL-AI 2026 submission — DeepSeek-R1-Distill v4.
Force-close </think>, think 1024 + answer 384, parser v3, CoT 768 on format fail.
4-bit BitsAndBytes for T4 16GB / 30min.
Thinking tokens: <think> … </think>
Serves both R1-Qwen-7B and R1-Llama-8B Hub repos.
"""
import os
os.environ["HF_HUB_OFFLINE"] = "1"
os.environ["TRANSFORMERS_OFFLINE"] = "1"
MODEL_ID = "."
THINKING_BUDGET = 1024
ANSWER_CONTINUATION_TOKENS = 384
COT_MAX_NEW_TOKENS = 768
START_THINKING = "<think>"
END_THINKING = "</think>"
import json
import re
import pandas as pd
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
bnb = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
)
SYSTEM = """You solve International Linguistics Olympiad (IOL) problems from the data you are given.
You may see a task type you have never seen: follow the instruction and examples, and answer in the same form they use.
What to return by task type:
- translation: only the required form in the language the query asks for — do not add extra glosses or "form | meaning" unless asked
- fill_blanks: only the missing form for each blank — no extra glosses
- match_letters: ONLY the option letter (A, B, C, …), one letter per line — never copy option text, never arrows, never "A. word"
- text_to_num: the number in digits only
- num_to_text: the number written out in words, in the language asked
- any other type: exactly what the instruction asks for, nothing else
Answer in the language and form the query asks for. Do not add glosses, translations, or explanations unless the instruction requires them.
Output rules:
- Put answers ONLY after a line that says exactly: FINAL ANSWERS:
- Never put answers before that marker.
- One answer per line; exactly as many lines as items asked in the query.
- Bare answers only: no numbering, no quotes, no commentary, no repeating the question."""
SYSTEM_COT = (
SYSTEM
+ "\n\nThink step by step about the rules in the examples and how they apply to the query, "
"then write FINAL ANSWERS: and the answer lines."
)
_MD_PREFIX = r"(?:[#*_=\-\s`>]*)"
_MARKER = re.compile(
rf"(?im)^{_MD_PREFIX}final\s+answers?{_MD_PREFIX}:?{_MD_PREFIX}\s*(.*)$"
)
_NUMBERING = re.compile(r"^\s*(?:\d+[.)]|[-*•])\s*")
_MD_WRAP = re.compile(r"^[*_`#\s]+|[*_`#\s]+$")
_TRAILING_LETTER = re.compile(
r"(?:[–—\-]|→|->)\s*([A-Za-z])(?:\s*[.)]|)\s*$"
)
_LEADING_LETTER_OPT = re.compile(r"^([A-Za-z])\s*[.):\-–—]\s+\S")
_WORD_THEN_LETTER = re.compile(r"^.+\s([A-Za-z])\s*$")
_REFUSAL = re.compile(
r"(?i)\b("
r"i'?m sorry|i am sorry|i don'?t have|i cannot|i can'?t|"
r"unable to|not able to|no reliable|cannot supply|can'?t supply|"
r"as an ai|i apologize"
r")\b"
)
_THINK_TAGS = re.compile(
re.escape(START_THINKING) + r"|" + re.escape(END_THINKING)
)
def _clean_line(line: str) -> str:
line = _NUMBERING.sub("", line).strip()
line = _MD_WRAP.sub("", line).strip()
line = line.replace("\u202f", " ").replace("\xa0", " ")
return line.strip()
def after_thinking(text: str) -> str:
if END_THINKING in text:
text = text.rsplit(END_THINKING, 1)[-1]
elif START_THINKING in text:
text = ""
return _THINK_TAGS.sub("", text)
def _as_option_letter(line: str) -> str | None:
line = _clean_line(line)
if not line:
return None
if len(line) == 1 and line.isalpha():
return line.upper()
m = _LEADING_LETTER_OPT.match(line)
if m:
return m.group(1).upper()
m = _TRAILING_LETTER.search(line)
if m:
return m.group(1).upper()
if len(line) <= 40:
m = _WORD_THEN_LETTER.match(line)
if m:
return m.group(1).upper()
return None
def _expand_line(line: str) -> list[str]:
line = _clean_line(line)
if not line:
return []
if len(line) == 1 and line.isalpha():
return [line]
if _LEADING_LETTER_OPT.match(line) or _TRAILING_LETTER.search(line):
letter = _as_option_letter(line)
if letter:
return [letter]
if len(line) <= 40 and _WORD_THEN_LETTER.match(line):
letter = _as_option_letter(line)
if letter:
return [letter]
if "|" in line:
parts = [p.strip() for p in line.split("|") if p.strip()]
if len(parts) >= 2:
if len(parts) >= 4 and len(parts) % 2 == 0:
left, right = parts[0::2], parts[1::2]
if sum(" " in r for r in right) >= max(1, len(right) // 2):
return [_clean_line(x) for x in left if _clean_line(x)]
if len(parts) == 2:
a, b = parts
if (" " in b and " " not in a) or (
len(b) > 2 * max(len(a), 1) and " " in b
):
return [_clean_line(a)] if _clean_line(a) else []
return [_clean_line(p) for p in parts if _clean_line(p)]
return [line]
def _dedupe_runaway(parts: list[str]) -> list[str]:
if len(parts) < 6:
return parts
out: list[str] = []
run = 0
prev = None
for p in parts:
if p == prev:
run += 1
if run >= 4:
break
else:
run = 1
prev = p
out.append(p)
return out
def _lines_from_region(region: str, *, allow_all_lines: bool) -> list[str]:
markers = list(_MARKER.finditer(region))
if markers:
last = markers[-1]
after_parts: list[str] = []
same = _clean_line(last.group(1) or "")
if same:
after_parts.extend(_expand_line(same))
for line in region[last.end() :].splitlines():
after_parts.extend(_expand_line(line))
if after_parts:
return _dedupe_runaway(after_parts)
before_parts: list[str] = []
for line in region[: last.start()].splitlines():
before_parts.extend(_expand_line(line))
if before_parts:
return _dedupe_runaway(before_parts)
parts: list[str] = []
for line in region.splitlines():
parts.extend(_expand_line(line))
if not parts:
return []
if allow_all_lines:
return _dedupe_runaway(parts)
return [parts[-1]]
def parse_answers(
raw: str,
*,
n_expected: int | None = None,
task_type: str = "",
) -> list[str]:
text = after_thinking(raw)
answers = _lines_from_region(text, allow_all_lines=False)
if task_type == "match_letters":
coerced = []
for a in answers:
letter = _as_option_letter(a)
coerced.append(letter if letter else a)
answers = coerced
if n_expected is not None and n_expected > 0 and len(answers) > n_expected:
answers = answers[:n_expected]
return answers
def _looks_like_alphabet_dump(answers: list[str]) -> bool:
letters = [
a.strip().upper()
for a in answers
if len(a.strip()) == 1 and a.strip().isalpha()
]
if len(letters) < 15:
return False
seq = 0
for i, L in enumerate(letters):
if ord(L) == ord("A") + i:
seq += 1
else:
break
return seq >= 15
def _looks_like_refusal(answers: list[str]) -> bool:
return bool(_REFUSAL.search(" ".join(answers)))
def has_usable_answer(
answers: list[str],
*,
n_expected: int | None = None,
task_type: str = "",
) -> bool:
if not answers or not any(a.strip() for a in answers):
return False
if _looks_like_refusal(answers) or _looks_like_alphabet_dump(answers):
return False
if n_expected is not None and n_expected > 0 and len(answers) != n_expected:
return False
if task_type == "match_letters":
letters = [a for a in answers if len(a) == 1 and a.isalpha()]
if len(letters) < max(1, int(0.8 * len(answers))):
return False
return True
def _n_items_guess(query: str) -> int:
nums = re.findall(r"(?m)^\s*(?:\(?\d+[.)]|\d+\))", query)
return len(nums) if nums else 0
def _end_thinking_id(tok) -> int:
end_id = tok.convert_tokens_to_ids(END_THINKING)
if end_id is None or end_id == tok.unk_token_id:
ids = tok.encode(END_THINKING, add_special_tokens=False)
if len(ids) == 1:
end_id = ids[0]
elif len(ids) > 1:
end_id = ids[-1]
if end_id is None or end_id == tok.unk_token_id:
raise RuntimeError(f"Tokenizer missing end-think token {END_THINKING!r}")
return int(end_id)
def _build_prompt_ids(tok, system: str, user: str):
messages = [
{"role": "system", "content": system},
{"role": "user", "content": user},
]
return tok.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt"
)
def _close_open_think(tok, prompt_ids, end_id: int):
"""R1 template opens <think>; for CoT, close it in the prompt so answers start immediately."""
device = prompt_ids.device
text = tok.decode(prompt_ids[0], skip_special_tokens=False)
if text.rstrip().endswith(START_THINKING) or (
START_THINKING in text and not text.rstrip().endswith(END_THINKING)
):
# If the prompt ends inside an open think block, append end token
if END_THINKING not in text.rsplit(START_THINKING, 1)[-1]:
extra = torch.tensor([[end_id]], device=device, dtype=prompt_ids.dtype)
return torch.cat([prompt_ids, extra], dim=1)
return prompt_ids
@torch.inference_mode()
def generate_with_think_budget(model, tok, prompt_ids, end_id: int):
device = next(model.parameters()).device
prompt_ids = prompt_ids.to(device)
prompt_len = prompt_ids.shape[-1]
think_out = model.generate(
prompt_ids,
max_new_tokens=THINKING_BUDGET,
do_sample=False,
pad_token_id=tok.pad_token_id or tok.eos_token_id,
)[0]
gen_ids = think_out[prompt_len:].tolist()
think_text = tok.decode(think_out[prompt_len:], skip_special_tokens=False)
if end_id not in gen_ids and END_THINKING not in think_text:
cont = torch.cat(
[think_out, torch.tensor([end_id], device=device, dtype=think_out.dtype)]
)
else:
cont = think_out
full = model.generate(
cont.unsqueeze(0),
max_new_tokens=ANSWER_CONTINUATION_TOKENS,
do_sample=False,
pad_token_id=tok.pad_token_id or tok.eos_token_id,
)[0]
return tok.decode(full[prompt_len:], skip_special_tokens=False).strip()
@torch.inference_mode()
def generate_plain(model, tok, prompt_ids, max_new_tokens: int):
device = next(model.parameters()).device
prompt_ids = prompt_ids.to(device)
prompt_len = prompt_ids.shape[-1]
out = model.generate(
prompt_ids,
max_new_tokens=max_new_tokens,
do_sample=False,
pad_token_id=tok.pad_token_id or tok.eos_token_id,
)[0]
return tok.decode(out[prompt_len:], skip_special_tokens=False).strip()
tok = AutoTokenizer.from_pretrained(MODEL_ID)
end_id = _end_thinking_id(tok)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID, quantization_config=bnb, device_map="auto"
).eval()
df = pd.read_csv("/tmp/data/test.csv", dtype=str).fillna("")
rows = []
for i, r in df.iterrows():
n_guess = _n_items_guess(r["query"])
task = str(r.get("task_type", "") or "")
n_exp = n_guess or None
user = f"{r['context'].strip()}\n\n{r['query'].strip()}"
if n_guess:
user += f"\n\n(Emit exactly {n_guess} answer line(s) after FINAL ANSWERS:.)"
ids = _build_prompt_ids(tok, SYSTEM, user)
text = generate_with_think_budget(model, tok, ids, end_id)
answers = parse_answers(text, n_expected=n_exp, task_type=task)
used_cot = False
if not has_usable_answer(answers, n_expected=n_exp, task_type=task):
used_cot = True
cot_ids = _build_prompt_ids(tok, SYSTEM_COT, user)
cot_ids = _close_open_think(tok, cot_ids.to(next(model.parameters()).device), end_id)
cot_text = generate_plain(model, tok, cot_ids, COT_MAX_NEW_TOKENS)
cot_answers = parse_answers(cot_text, n_expected=n_exp, task_type=task)
if has_usable_answer(cot_answers, n_expected=n_exp, task_type=task):
answers = cot_answers
rows.append({"id": r["id"], "pred": json.dumps(answers, ensure_ascii=False)})
print(f"[{i + 1}/{len(df)}] {len(answers)} answers cot={used_cot}", flush=True)
pd.DataFrame(rows).to_csv("submission.csv", index=False)
print("wrote submission.csv", flush=True)

303282
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

35
tokenizer_config.json Normal file
View File

@@ -0,0 +1,35 @@
{
"add_bos_token": true,
"add_eos_token": false,
"bos_token": {
"__type": "AddedToken",
"content": "<begin▁of▁sentence>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"clean_up_tokenization_spaces": false,
"eos_token": {
"__type": "AddedToken",
"content": "<end▁of▁sentence>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"legacy": true,
"model_max_length": 16384,
"pad_token": {
"__type": "AddedToken",
"content": "<end▁of▁sentence>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"sp_model_kwargs": {},
"unk_token": null,
"tokenizer_class": "LlamaTokenizerFast",
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<User>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<Assistant><tool▁calls▁begin><tool▁call▁begin>' + tool['type'] + '<tool▁sep>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<tool▁call▁end>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<tool▁call▁begin>' + tool['type'] + '<tool▁sep>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<tool▁call▁end>'}}{{'<tool▁calls▁end><end▁of▁sentence>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<tool▁outputs▁end>' + message['content'] + '<end▁of▁sentence>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<Assistant>' + content + '<end▁of▁sentence>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<tool▁outputs▁begin><tool▁output▁begin>' + message['content'] + '<tool▁output▁end>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<tool▁output▁begin>' + message['content'] + '<tool▁output▁end>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<tool▁outputs▁end>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<Assistant><think>\\n'}}{% endif %}"
}