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

Model: OpenBMB/AgentCPM-Report
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-05-23 03:07:12 +08:00
commit 5c1979bb6a
18 changed files with 494364 additions and 0 deletions

47
.gitattributes vendored Normal file
View File

@@ -0,0 +1,47 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bin.* filter=lfs diff=lfs merge=lfs -text
*.bz2 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
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack 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
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
saved_model/**/* 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
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zstandard filter=lfs diff=lfs merge=lfs -text
*.tfevents* filter=lfs diff=lfs merge=lfs -text
*.db* filter=lfs diff=lfs merge=lfs -text
*.ark* filter=lfs diff=lfs merge=lfs -text
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.gguf* filter=lfs diff=lfs merge=lfs -text
*.ggml filter=lfs diff=lfs merge=lfs -text
*.llamafile* filter=lfs diff=lfs merge=lfs -text
*.pt2 filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text

363
README.md Normal file
View File

@@ -0,0 +1,363 @@
---
license: apache-2.0
library_name: transformers
pipeline_tag: text-generation
tags:
- agent
- text-generation-inference
---
# AgentCPM-Report: Gemini-2.5-pro-DeepResearch Level Local DeepResearch
<p align="center">
<a href='https://huggingface.co/openbmb/AgentCPM-Report'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-AgentCPM--Report-yellow'>
<a href='https://huggingface.co/openbmb/AgentCPM-Report-GGUF'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-AgentCPM--Report--GGUF-yellow'>
<a href='https://github.com/OpenBMB/AgentCPM'><img src='https://img.shields.io/badge/GitHub-AgentCPM-blue?logo=github'>
<a href='https://github.com/OpenBMB/UltraRAG'><img src='https://img.shields.io/badge/GitHub-UltraRAG-blue?logo=github'>
<a href='https://arxiv.org/abs/2602.06540'><img src='https://img.shields.io/badge/arXiv-2602.06540-red'>
</p>
This repository contains **AgentCPM-Report**, an 8B-parameter deep research agent introduced in the paper [AgentCPM-Report: Interleaving Drafting and Deepening for Open-Ended Deep Research](https://arxiv.org/abs/2602.06540).
AgentCPM-Report uses a **Writing As Reasoning Policy (WARP)** to dynamically revise outlines during report generation, alternating between evidence-based drafting and reasoning-driven deepening to produce high-quality, long-form research reports.
## Links & Resources
### 📊 AgentCPM-Report Models
- **[AgentCPM-Report](https://huggingface.co/openbmb/AgentCPM-Report)** The Gemini-2.5-pro-DeepResearch Level Local DeepResearch Model
- **[AgentCPM-Report-GGUF](https://huggingface.co/openbmb/AgentCPM-Report-GGUF)** The GGUF version of AgentCPM-Report
### 🤖 AgentCPM-Explore Models
- **[AgentCPM-Explore](https://huggingface.co/openbmb/AgentCPM-Explore)** The first open-source agent model with 4B parameters to appear on 8 widely used long-horizon agent benchmarks.
- **[AgentCPM-Explore-GGUF](https://huggingface.co/openbmb/AgentCPM-Explore-GGUF)** The GGUF version of AgentCPM-Explore
### 💻 Code & Framework
- **[AgentCPM](https://github.com/OpenBMB/AgentCPM)** Our code for AgentCPM Series
- **[UltraRAG](https://github.com/OpenBMB/UltraRAG)** A RAG Framework, Less Code, Lower Barrier, Faster Deployment
## News
- [2026-01-20] 🚀🚀🚀 We open-sourced AgentCPM-Report built on MiniCPM4.1-8B, capable of matching top closed-source commercial systems like Gemini-2.5-pro-DeepResearch in report generation.
## Overview
AgentCPM-Report is an open-source large language model agent jointly developed by [THUNLP](https://nlp.csai.tsinghua.edu.cn), Renmin University of China [RUCBM](https://github.com/RUCBM), and [ModelBest](https://modelbest.cn/en). It is based on the [MiniCPM4.1](https://github.com/OpenBMB/MiniCPM) 8B-parameter base model. It accepts user instructions as input and autonomously generates long-form reports. Key highlights:
- **Extreme Performance, Minimal Footprint**: Through an average of 40 rounds of deep retrieval and nearly 100 rounds of chain-of-thought reasoning, it achieves comprehensive information mining and restructuring, enabling edge-side models to produce logically rigorous, deeply insightful long-form articles with tens of thousands of words. With just 8 billion parameters, it delivers performance on par with top-tier closed-source systems in deep research tasks.
- **Physical Isolation, Local Security**: Specifically designed for high-privacy scenarios, it supports fully offline and agile local deployment, completely eliminating the risk of cloud data leaks. Leveraging our UltraRAG framework, it efficiently mounts and understands your local private knowledge base, securely transforming core confidential data into highly valuable professional decision-making reports without ever leaving its domain.
## Demo Cases
<div align="center">
<a href="https://www.youtube.com/watch?v=d5XWONt0PWo"><img src="https://img.youtube.com/vi/d5XWONt0PWo/0.jpg", width=70%></a>
</div>
**You can watch our demo video here [Demo](https://www.youtube.com/watch?v=d5XWONt0PWo) 🔗**
## Quick Start
### Docker Deployment
<div align="center">
<a href="https://www.youtube.com/watch?v=ze8qJRrass4"><img src="https://img.youtube.com/vi/ze8qJRrass4/0.jpg", width=70%></a>
</div>
**You can watch our demo video here [Tutorial](https://www.youtube.com/watch?v=ze8qJRrass4) 🔗**
We provide a minimal one-click `docker-compose` deployment integrated with UltraRAG, including the RAG framework UltraRAG2.0, the model inference framework vllm, and the vector database milvus. If you want CPU inference, we also provide a llama.cpp-based version for gguf models—just switch `docker-compose.yml` to `docker-compose.cpu.yml`.
``` bash
git clone git@github.com:OpenBMB/UltraRAG.git
cd UltraRAG
git checkout agentcpm-report-demo
cd agentcpm-report-demo
cp env.example .env
docker-compose -f docker-compose.yml up -d --build
docker-compose -f docker-compose.yml logs -f ultrarag-ui
```
The first startup pulls images, downloads the model, and configures the environment, which takes about 30 minutes.
Then open `http://localhost:5050`. If you can see the UI, your deployment is successful.
Follow the UI instructions to upload local files, chunk them, and build indexes; then in the Chat section, select AgentCPM-Report in the pipeline to start your workflow.
(Optional) You can import [Wiki2024](https://modelscope.cn/datasets/UltraRAG/UltraRAG_Benchmark/tree/master/corpus/wiki24) as the writing database.
You can read more tutorials about AgentCPM-Report in the [documentation](https://ultrarag.openbmb.cn/pages/en/demo/deepresearch).
## Evaluation
<table align="center">
<thead>
<tr>
<th align="center">DeepResearch Bench</th>
<th align="center">Overall</th>
<th align="center">Comprehensiveness</th>
<th align="center">Insight</th>
<th align="center">Instruction Following</th>
<th align="center">Readability</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">Doubao-research</td>
<td align="center">44.34</td>
<td align="center">44.84</td>
<td align="center">40.56</td>
<td align="center">47.95</td>
<td align="center">44.69</td>
</tr>
<tr>
<td align="center">Claude-research</td>
<td align="center">45.00</td>
<td align="center">45.34</td>
<td align="center">42.79</td>
<td align="center">47.58</td>
<td align="center">44.66</td>
</tr>
<tr>
<td align="center">OpenAI-deepresearch</td>
<td align="center">46.45</td>
<td align="center">46.46</td>
<td align="center">43.73</td>
<td align="center">49.39</td>
<td align="center">47.22</td>
</tr>
<tr>
<td align="center">Gemini-2.5-Pro-deepresearch</td>
<td align="center">49.71</td>
<td align="center">49.51</td>
<td align="center">49.45</td>
<td align="center">50.12</td>
<td align="center">50.00</td>
</tr>
<tr>
<td align="center">WebWeaver(Qwen3-30B-A3B)</td>
<td align="center">46.77</td>
<td align="center">45.15</td>
<td align="center">45.78</td>
<td align="center">49.21</td>
<td align="center">47.34</td>
</tr>
<tr>
<td align="center">WebWeaver(Claude-Sonnet-4)</td>
<td align="center">50.58</td>
<td align="center">51.45</td>
<td align="center">50.02</td>
<td align="center">50.81</td>
<td align="center">49.79</td>
</tr>
<tr>
<td align="center">Enterprise-DR(Gemini-2.5-Pro)</td>
<td align="center">49.86</td>
<td align="center">49.01</td>
<td align="center">50.28</td>
<td align="center">50.03</td>
<td align="center">49.98</td>
</tr>
<tr>
<td align="center">RhinoInsigh(Gemini-2.5-Pro)</td>
<td align="center">50.92</td>
<td align="center">50.51</td>
<td align="center">51.45</td>
<td align="center">51.72</td>
<td align="center">50.00</td>
</tr>
<tr>
<td align="center">AgentCPM-Report</td>
<td align="center">50.11</td>
<td align="center">50.54</td>
<td align="center">52.64</td>
<td align="center">48.87</td>
<td align="center">44.17</td>
</tr>
</tbody>
</table>
<table align="center">
<thead>
<tr>
<th align="center">DeepResearch Gym</th>
<th align="center">Avg.</th>
<th align="center">Clarity</th>
<th align="center">Depth</th>
<th align="center">Balance</th>
<th align="center">Breadth</th>
<th align="center">Support</th>
<th align="center">Insightfulness</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">Doubao-research</td>
<td align="center">84.46</td>
<td align="center">68.85</td>
<td align="center">93.12</td>
<td align="center">83.96</td>
<td align="center">93.33</td>
<td align="center">84.38</td>
<td align="center">83.12</td>
</tr>
<tr>
<td align="center">Claude-research</td>
<td align="center">80.25</td>
<td align="center">86.67</td>
<td align="center">96.88</td>
<td align="center">84.41</td>
<td align="center">96.56</td>
<td align="center">26.77</td>
<td align="center">90.22</td>
</tr>
<tr>
<td align="center">OpenAI-deepresearch</td>
<td align="center">91.27</td>
<td align="center">84.90</td>
<td align="center">98.10</td>
<td align="center">89.80</td>
<td align="center">97.40</td>
<td align="center">88.40</td>
<td align="center">89.00</td>
</tr>
<tr>
<td align="center">Gemini-2.5-pro-deepresearch</td>
<td align="center">96.02</td>
<td align="center">90.71</td>
<td align="center">99.90</td>
<td align="center">93.37</td>
<td align="center">99.69</td>
<td align="center">95.00</td>
<td align="center">97.45</td>
</tr>
<tr>
<td align="center">WebWeaver (Qwen3-30b-a3b)</td>
<td align="center">77.27</td>
<td align="center">71.88</td>
<td align="center">85.51</td>
<td align="center">75.80</td>
<td align="center">84.78</td>
<td align="center">63.77</td>
<td align="center">81.88</td>
</tr>
<tr>
<td align="center">WebWeaver (Claude-sonnet-4)</td>
<td align="center">96.77</td>
<td align="center">90.50</td>
<td align="center">99.87</td>
<td align="center">94.30</td>
<td align="center">100.00</td>
<td align="center">98.73</td>
<td align="center">97.22</td>
</tr>
<tr>
<td align="center">AgentCPM-Report</td>
<td align="center">98.48</td>
<td align="center">95.10</td>
<td align="center">100.00</td>
<td align="center">98.50</td>
<td align="center">100.00</td>
<td align="center">97.30</td>
<td align="center">100.00</td>
</tr>
</tbody>
</table>
<table align="center">
<thead>
<tr>
<th align="center">DeepConsult</th>
<th align="center">Avg.</th>
<th align="center">Win</th>
<th align="center">Tie</th>
<th align="center">Lose</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">Doubao-research</td>
<td align="center">5.42</td>
<td align="center">29.95</td>
<td align="center">40.35</td>
<td align="center">29.70</td>
</tr>
<tr>
<td align="center">Claude-research</td>
<td align="center">4.60</td>
<td align="center">25.00</td>
<td align="center">38.89</td>
<td align="center">36.11</td>
</tr>
<tr>
<td align="center">OpenAI-deepresearch</td>
<td align="center">5.00</td>
<td align="center">0.00</td>
<td align="center">100.00</td>
<td align="center">0.00</td>
</tr>
<tr>
<td align="center">Gemini-2.5-Pro-deepresearch</td>
<td align="center">6.70</td>
<td align="center">61.27</td>
<td align="center">31.13</td>
<td align="center">7.60</td>
</tr>
<tr>
<td align="center">WebWeaver(Qwen3-30B-A3B)</td>
<td align="center">4.57</td>
<td align="center">28.65</td>
<td align="center">34.90</td>
<td align="center">36.46</td>
</tr>
<tr>
<td align="center">WebWeaver(Claude-Sonnet-4)</td>
<td align="center">6.96</td>
<td align="center">66.86</td>
<td align="center">10.47</td>
<td align="center">22.67</td>
</tr>
<tr>
<td align="center">Enterprise-DR(Gemini-2.5-Pro)</td>
<td align="center">6.82</td>
<td align="center">71.57</td>
<td align="center">19.12</td>
<td align="center">9.31</td>
</tr>
<tr>
<td align="center">RhinoInsigh(Gemini-2.5-Pro)</td>
<td align="center">6.82</td>
<td align="center">68.51</td>
<td align="center">11.02</td>
<td align="center">20.47</td>
</tr>
<tr>
<td align="center">AgentCPM-Report</td>
<td align="center">6.60</td>
<td align="center">57.60</td>
<td align="center">13.73</td>
<td align="center">28.68</td>
</tr>
</tbody>
</table>
Our evaluation datasets include DeepResearch Bench, DeepConsult, and DeepResearch Gym. The writing-time knowledge base includes about 2.7 million [Arxiv papers](https://www.kaggle.com/api/v1/datasets/download/Cornell-University/arxiv) and about 200,000 internal webpage summaries.
## Acknowledgements
This project would not be possible without the support and contributions of the open-source community. During development, we referred to and used multiple excellent open-source frameworks, models, and data resources, including [verl](https://github.com/volcengine/verl), [UltraRAG](https://github.com/OpenBMB/UltraRAG), [MiniCPM4.1](https://github.com/OpenBMB/MiniCPM), and [SurveyGo](https://surveygo.modelbest.cn/).
## Contributions
Project leads: Yishan Li, Wentong Chen
Contributors: Yishan Li, Wentong Chen, Yukun Yan, Mingwei Li, Sen Mei, Xiaorong Wang, Kunpeng Liu, Xin Cong, Shuo Wang, Zhong Zhang, Yaxi Lu, Zhenghao Liu, Yankai Lin, Zhiyuan Liu, Maosong Sun
Advisors: Yukun Yan, Yankai Lin, Zhiyuan Liu, Maosong Sun
## Citation
If **AgentCPM-Report** is helpful for your research, please cite it as follows:
```bibtex
@misc{li2026agentcpmreport,
title={AgentCPM-Report: Interleaving Drafting and Deepening for Open-Ended Deep Research},
author={Yishan Li and Wentong Chen and Yukun Yan and Mingwei Li and Sen Mei and Xiaorong Wang and Kunpeng Liu and Xin Cong and Shuo Wang and Zhong Zhang and Yaxi Lu and Zhenghao Liu and Yankai Lin and Zhiyuan Liu and Maosong Sun},
year={2026},
eprint={2602.06540},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2602.06540},
}
```

10
added_tokens.json Normal file
View File

@@ -0,0 +1,10 @@
{
"<|execute_end|>": 73444,
"<|execute_start|>": 73443,
"<|fim_middle|>": 73446,
"<|fim_prefix|>": 73445,
"<|fim_suffix|>": 73447,
"<|im_end|>": 73440,
"<|im_start|>": 73441,
"<|tool_call|>": 73442
}

7
chat_template.jinja Normal file
View File

@@ -0,0 +1,7 @@
{% for message in messages %}{{'<|im_start|>' + message['role'] + '
' + message['content'] + '<|im_end|>' + '
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
' }}{% if enable_thinking is defined and enable_thinking is false %}{{ '<think>
</think>
' }}{% endif %}{% endif %}

175
config.json Normal file
View File

@@ -0,0 +1,175 @@
{
"architectures": [
"MiniCPMForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"auto_map": {
"AutoConfig": "configuration_minicpm.MiniCPMConfig",
"AutoModel": "modeling_minicpm.MiniCPMForCausalLM",
"AutoModelForCausalLM": "modeling_minicpm.MiniCPMForCausalLM",
"AutoModelForSeq2SeqLM": "modeling_minicpm.MiniCPMForCausalLM",
"AutoModelForSequenceClassification": "modeling_minicpm.MiniCPMForSequenceClassification"
},
"bos_token_id": 1,
"dim_model_base": 256,
"eos_token_id": 73440,
"hidden_act": "silu",
"hidden_size": 4096,
"initializer_range": 0.1,
"intermediate_size": 16384,
"max_position_embeddings": 65536,
"model_type": "minicpm",
"mup_denominator": 32,
"num_attention_heads": 32,
"num_hidden_layers": 32,
"num_key_value_heads": 2,
"pad_token_id": 73440,
"pretraining_tp": 1,
"rms_norm_eps": 1e-06,
"rope_scaling": {
"long_factor": [
0.9982316082870437,
1.033048153422584,
1.0749920956484724,
1.1255096879436193,
1.1863348602111476,
1.259543828902579,
1.3476188888731149,
1.4535223827776373,
1.5807816745852985,
1.7335856049489526,
1.9168922912975785,
2.1365471404135326,
2.3994084200118646,
2.713475511863602,
3.0880118452194134,
3.533650295140154,
4.062463396503134,
4.687974098908333,
5.425075306704039,
6.289818967956352,
7.29902962722721,
8.469695779093664,
9.81809877306655,
11.358657902065282,
13.102505860712087,
15.055862949967128,
17.218348131364184,
19.581439255386453,
22.127353314656723,
24.828633849376587,
27.6486820771775,
30.54334096108829,
33.46345345363812,
36.358112337548896,
39.17816056534983,
41.879441100069684,
44.425355159339965,
46.78844628336223,
48.95093146475928,
50.90428855401433,
52.648136512661125,
54.18869564165987,
55.537098635632745,
56.7077647874992,
57.71697544677006,
58.58171910802236,
59.31882031581807,
59.94433101822328,
60.47314411958625,
60.918782569507,
61.29331890286281,
61.60738599471455,
61.87024727431288,
62.089902123428836,
62.27320880977746,
62.42601274014111,
62.55327203194878,
62.65917552585329,
62.74725058582382,
62.82045955451526,
62.88128472678279,
62.931802319077946,
62.97374626130382,
63.008562806439365
],
"original_max_position_embeddings": 65536,
"rope_type": "longrope",
"short_factor": [
0.9982316082870437,
1.033048153422584,
1.0749920956484724,
1.1255096879436193,
1.1863348602111476,
1.259543828902579,
1.3476188888731149,
1.4535223827776373,
1.5807816745852985,
1.7335856049489526,
1.9168922912975785,
2.1365471404135326,
2.3994084200118646,
2.713475511863602,
3.0880118452194134,
3.533650295140154,
4.062463396503134,
4.687974098908333,
5.425075306704039,
6.289818967956352,
7.29902962722721,
8.469695779093664,
9.81809877306655,
11.358657902065282,
13.102505860712087,
15.055862949967128,
17.218348131364184,
19.581439255386453,
22.127353314656723,
24.828633849376587,
27.6486820771775,
30.54334096108829,
33.46345345363812,
36.358112337548896,
39.17816056534983,
41.879441100069684,
44.425355159339965,
46.78844628336223,
48.95093146475928,
50.90428855401433,
52.648136512661125,
54.18869564165987,
55.537098635632745,
56.7077647874992,
57.71697544677006,
58.58171910802236,
59.31882031581807,
59.94433101822328,
60.47314411958625,
60.918782569507,
61.29331890286281,
61.60738599471455,
61.87024727431288,
62.089902123428836,
62.27320880977746,
62.42601274014111,
62.55327203194878,
62.65917552585329,
62.74725058582382,
62.82045955451526,
62.88128472678279,
62.931802319077946,
62.97374626130382,
63.008562806439365
]
},
"rope_theta": 10000.0,
"scale_depth": 1.4,
"scale_emb": 12,
"sparse_config": null,
"tie_word_embeddings": false,
"torch_dtype": "bfloat16",
"transformers_version": "4.52.4",
"use_cache": false,
"vocab_size": 73448
}

1
configuration.json Normal file
View File

@@ -0,0 +1 @@
{"framework":"Pytorch","task":"text-generation"}

203
configuration_minicpm.py Normal file
View File

@@ -0,0 +1,203 @@
# coding=utf-8
# Copyright 2025 The OpenBMB Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
""" MiniCPM model configuration"""
from transformers.configuration_utils import PretrainedConfig
from transformers.utils import logging
logger = logging.get_logger(__name__)
MINICPM_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
class MiniCPMConfig(PretrainedConfig):
r"""
This is the configuration class to store the configuration of a [`MiniCPMModel`]. It is used to instantiate an MiniCPM
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the MiniCPM-7B.
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
documentation from [`PretrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
Vocabulary size of the MiniCPM model. Defines the number of different tokens that can be represented by the
`inputs_ids` passed when calling [`MiniCPMModel`]
hidden_size (`int`, *optional*, defaults to 4096):
Dimension of the hidden representations.
intermediate_size (`int`, *optional*, defaults to 11008):
Dimension of the MLP representations.
num_hidden_layers (`int`, *optional*, defaults to 32):
Number of hidden layers in the Transformer decoder.
num_attention_heads (`int`, *optional*, defaults to 32):
Number of attention heads for each attention layer in the Transformer decoder.
num_key_value_heads (`int`, *optional*):
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
`num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
by meanpooling all the original heads within that group. For more details checkout [this
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
`num_attention_heads`.
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
The non-linear activation function (function or string) in the decoder.
max_position_embeddings (`int`, *optional*, defaults to 2048):
The maximum sequence length that this model might ever be used with. MiniCPM 1 supports up to 2048 tokens,
MiniCPM 2 up to 4096, CodeMiniCPM up to 16384.
initializer_range (`float`, *optional*, defaults to 0.02):
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
rms_norm_eps (`float`, *optional*, defaults to 1e-06):
The epsilon used by the rms normalization layers.
use_cache (`bool`, *optional*, defaults to `True`):
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if `config.is_decoder=True`.
pad_token_id (`int`, *optional*):
Padding token id.
bos_token_id (`int`, *optional*, defaults to 1):
Beginning of stream token id.
eos_token_id (`int`, *optional*, defaults to 2):
End of stream token id.
pretraining_tp (`int`, *optional*, defaults to 1):
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
document](https://huggingface.co/docs/transformers/parallelism) to understand more about it. This value is
necessary to ensure exact reproducibility of the pretraining results. Please refer to [this
issue](https://github.com/pytorch/pytorch/issues/76232).
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
Whether to tie weight embeddings
rope_theta (`float`, *optional*, defaults to 10000.0):
The base period of the RoPE embeddings.
rope_scaling (`Dict`, *optional*):
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
`{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
`max_position_embeddings` to the expected new maximum. See the following thread for more information on how
these scaling strategies behave:
https://www.reddit.com/r/LocalMiniCPM/comments/14mrgpr/dynamically_scaled_rope_further_increases/. This is an
experimental feature, subject to breaking API changes in future versions.
attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
Whether to use a bias in the query, key, value and output projection layers during self-attention.
attention_dropout (`float`, *optional*, defaults to 0.0):
The dropout ratio for the attention probabilities.
```python
>>> from transformers import MiniCPMModel, MiniCPMConfig
>>> # Initializing a MiniCPM minicpm-7b style configuration
>>> configuration = MiniCPMConfig()
>>> # Initializing a model from the minicpm-7b style configuration
>>> model = MiniCPMModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
```"""
model_type = 'minicpm'
keys_to_ignore_at_inference = ['past_key_values']
def __init__(
self,
vocab_size=32000,
hidden_size=4096,
intermediate_size=11008,
num_hidden_layers=32,
num_attention_heads=32,
num_key_value_heads=None,
hidden_act='silu',
max_position_embeddings=2048,
initializer_range=0.02,
rms_norm_eps=1e-6,
use_cache=True,
pad_token_id=None,
bos_token_id=1,
eos_token_id=2,
pretraining_tp=1,
tie_word_embeddings=True,
rope_theta=10000.0,
rope_scaling=None,
attention_bias=False,
attention_dropout=0.0,
scale_emb=1,
dim_model_base=1,
scale_depth=1,
mup_denominator=32,
sparse_config=None,
**kwargs):
self.vocab_size = vocab_size
self.max_position_embeddings = max_position_embeddings
self.hidden_size = hidden_size
self.intermediate_size = intermediate_size
self.num_hidden_layers = num_hidden_layers
self.num_attention_heads = num_attention_heads
# for backward compatibility
if num_key_value_heads is None:
num_key_value_heads = num_attention_heads
self.num_key_value_heads = num_key_value_heads
self.hidden_act = hidden_act
self.initializer_range = initializer_range
self.rms_norm_eps = rms_norm_eps
self.pretraining_tp = pretraining_tp
self.use_cache = use_cache
self.rope_theta = rope_theta
self.rope_scaling = rope_scaling
# self._rope_scaling_validation()
self.attention_bias = attention_bias
self.attention_dropout = attention_dropout
self.scale_emb = scale_emb
self.dim_model_base = dim_model_base
self.scale_depth = scale_depth
# only used for Eagle Head
self.mup_denominator = mup_denominator
# sparse config
self.sparse_config = sparse_config
super().__init__(
pad_token_id=pad_token_id,
bos_token_id=bos_token_id,
eos_token_id=eos_token_id,
tie_word_embeddings=tie_word_embeddings,
**kwargs,
)
try:
import flash_attn
self._attn_implementation = 'flash_attention_2'
except:
pass
def _rope_scaling_validation(self):
"""
Validate the `rope_scaling` configuration.
"""
if self.rope_scaling is None:
return
if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:
raise ValueError(
'`rope_scaling` must be a dictionary with with two fields, `type` and `factor`, '
f'got {self.rope_scaling}'
)
rope_scaling_type = self.rope_scaling.get('type', None)
rope_scaling_factor = self.rope_scaling.get('factor', None)
if rope_scaling_type is None or rope_scaling_type not in ['linear', 'dynamic']:
raise ValueError(
f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}"
)
if rope_scaling_factor is None or not isinstance(rope_scaling_factor, float) or rope_scaling_factor <= 1.0:
raise ValueError(f"`rope_scaling`'s factor field must be a float > 1, got {rope_scaling_factor}")

8
generation_config.json Normal file
View File

@@ -0,0 +1,8 @@
{
"_from_model_config": true,
"bos_token_id": 1,
"eos_token_id": 73440,
"pad_token_id": 73440,
"transformers_version": "4.52.4",
"use_cache": false
}

View File

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

View File

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

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:323fb1bb60247c2e0bb581a2399b43d504872a677892a41e46ccac5f1b83ffdf
size 4949487768

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7de50a0ba3442d16341142dd1b61dded2c7276c26394b05191a075cb1594f4b7
size 1495305288

View File

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

2235
modeling_minicpm.py Normal file

File diff suppressed because it is too large Load Diff

40
special_tokens_map.json Normal file
View File

@@ -0,0 +1,40 @@
{
"additional_special_tokens": [
"<|im_end|>",
"<|im_start|>",
"<|tool_call|>",
"<|execute_start|>",
"<|execute_end|>",
"<|fim_prefix|>",
"<|fim_middle|>",
"<|fim_suffix|>"
],
"bos_token": {
"content": "<s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "<unk>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

490843
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

3
tokenizer.model Normal file
View File

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

119
tokenizer_config.json Normal file
View File

@@ -0,0 +1,119 @@
{
"add_bos_token": true,
"add_eos_token": false,
"add_prefix_space": null,
"added_tokens_decoder": {
"0": {
"content": "<unk>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"1": {
"content": "<s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "</s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"73440": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"73441": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"73442": {
"content": "<|tool_call|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"73443": {
"content": "<|execute_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"73444": {
"content": "<|execute_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"73445": {
"content": "<|fim_prefix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"73446": {
"content": "<|fim_middle|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"73447": {
"content": "<|fim_suffix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"additional_special_tokens": [
"<|im_end|>",
"<|im_start|>",
"<|tool_call|>",
"<|execute_start|>",
"<|execute_end|>",
"<|fim_prefix|>",
"<|fim_middle|>",
"<|fim_suffix|>"
],
"bos_token": "<s>",
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"extra_special_tokens": {},
"legacy": true,
"model_max_length": 1000000000000000019884624838656,
"pad_token": "<|im_end|>",
"padding_side": "right",
"sp_model_kwargs": {},
"spaces_between_special_tokens": false,
"split_special_tokens": false,
"tokenizer_class": "LlamaTokenizer",
"unk_token": "<unk>",
"use_default_system_prompt": false
}