Instructions to use openbmb/MiniCPM-2B-history with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-2B-history with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM-2B-history", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM-2B-history", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM-2B-history with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM-2B-history" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/MiniCPM-2B-history", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM-2B-history
- SGLang
How to use openbmb/MiniCPM-2B-history with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "openbmb/MiniCPM-2B-history" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/MiniCPM-2B-history", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "openbmb/MiniCPM-2B-history" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/MiniCPM-2B-history", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/MiniCPM-2B-history with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-2B-history
Update README.md
Browse files
README.md
CHANGED
|
@@ -22,9 +22,11 @@ tags:
|
|
| 22 |
</p>
|
| 23 |
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
【**Caution**】:<font color='red'>This repo contains the intermediate checkpoints of minicpm-2b training for research purpose, not the final checkpoints that are ready to be used in practice. </font> We >ave checkpoints every 500 steps. However, due to the efficiency of uploading, we only open-source the ones that has step % 100000 == 0. Among these checkpoints, 0-260000 (more accurately, 261000) are the stable training stable. 260000 - 280000 (more accurately 261000 - 279500) are the decay stage. After 280000 are the un-utilized checkpoints where the learning rate is decayed to every small value.
|
| 28 |
MiniCPM 是面壁与清华大学自然语言处理实验室共同开源的系列端侧语言大模型,主体语言模型 MiniCPM-2B 仅有 24亿(2.4B)的非词嵌入参数量。
|
| 29 |
- 经过 SFT 后,MiniCPM 在公开综合性评测集上,MiniCPM 与 Mistral-7B相近(中文、数学、代码能力更优),整体性能超越 Llama2-13B、MPT-30B、Falcon-40B 等模型。
|
| 30 |
- 经过 DPO 后,MiniCPM 在当前最接近用户体感的评测集 MTBench上,MiniCPM-2B 也超越了 Llama2-70B-Chat、Vicuna-33B、Mistral-7B-Instruct-v0.1、Zephyr-7B-alpha 等众多代表性开源大模型。
|
|
|
|
| 22 |
</p>
|
| 23 |
|
| 24 |
|
| 25 |
+
<font color='red'>【注意】:本仓库为minicpm-2b 在训练过程中的checkpoint (服务于研究目的),不是最终可用的模型文件!</font> 我们每隔500次保存了一个检查点,然而由于上传huggingface效率原因,只开放了 step % 10000 == 0 的那些检查点。 其中 0-260000 (更准确地 261000) 步为稳定训练阶段, 260000 - 280000 为退火阶段 (更准确的,261000 - 279500), 280000之后是没有被利用的剩余退火阶段,这个剩余退火阶段学习率已经变得非常小了,并且没有收益。
|
| 26 |
+
|
| 27 |
+
<font color='red'>【Caution】:This repo contains the intermediate checkpoints of minicpm-2b training for research purpose, not the final checkpoints that are ready to be used in practice. </font> We saved checkpoints every 500 steps. However, due to the efficiency of uploading, we only open-source the ones that has step % 100000 == 0. Among these checkpoints, 0-260000 (more accurately, 261000) are the stable training stable. 260000 - 280000 (more accurately 261000 - 279500) are the decay stage. After 280000 are the un-utilized checkpoints where the learning rate is decayed to every small value.
|
| 28 |
+
|
| 29 |
|
|
|
|
| 30 |
MiniCPM 是面壁与清华大学自然语言处理实验室共同开源的系列端侧语言大模型,主体语言模型 MiniCPM-2B 仅有 24亿(2.4B)的非词嵌入参数量。
|
| 31 |
- 经过 SFT 后,MiniCPM 在公开综合性评测集上,MiniCPM 与 Mistral-7B相近(中文、数学、代码能力更优),整体性能超越 Llama2-13B、MPT-30B、Falcon-40B 等模型。
|
| 32 |
- 经过 DPO 后,MiniCPM 在当前最接近用户体感的评测集 MTBench上,MiniCPM-2B 也超越了 Llama2-70B-Chat、Vicuna-33B、Mistral-7B-Instruct-v0.1、Zephyr-7B-alpha 等众多代表性开源大模型。
|