Text Generation
Transformers
PyTorch
English
Chinese
MiniCPM
ModelBest
THUNLP
conversational
custom_code
Instructions to use openbmb/MiniCPM-2B-dpo-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-2B-dpo-bf16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM-2B-dpo-bf16", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM-2B-dpo-bf16", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM-2B-dpo-bf16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM-2B-dpo-bf16" # 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-dpo-bf16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM-2B-dpo-bf16
- SGLang
How to use openbmb/MiniCPM-2B-dpo-bf16 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-dpo-bf16" \ --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-dpo-bf16", "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-dpo-bf16" \ --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-dpo-bf16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/MiniCPM-2B-dpo-bf16 with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-2B-dpo-bf16
Run MiniCPM-2B on CPU
#2
by J22 - opened
https://github.com/foldl/chatllm.cpp
________ __ __ __ __ ___
/ ____/ /_ ____ _/ /_/ / / / / |/ /_________ ____
/ / / __ \/ __ `/ __/ / / / / /|_/ // ___/ __ \/ __ \
/ /___/ / / / /_/ / /_/ /___/ /___/ / / // /__/ /_/ / /_/ /
\____/_/ /_/\__,_/\__/_____/_____/_/ /_(_)___/ .___/ .___/
You are served by MiniCPM, /_/ /_/
with 2724880896 (2.7B) parameters.
You > 山东省最高的山是哪座山, 它比黄山高还是矮?差距多少?
A.I. > 山东省最高的山是泰山,位于山东省泰安市。泰山海拔1545米,是中国五岳之一,也是山东省最高峰。
黄山位于安徽省黄山市,是中国五岳之一,海拔1864米。从海拔上来看,泰山比黄山低,黄山比泰山高。黄山比泰山高约319米。
So grateful for your contribution
jctime changed discussion status to closed
This comment has been hidden
用单机单卡微调完后,出现一堆checkpoint文件夹,跟下载下来的模型目录结构不同,这个是需要有什么后续操作才能部署吗?
需要导出为与下载的模型目录相同的结构,才能转换。
需要导出为与下载的模型目录相同的结构,才能转换。
你好,导出是咋弄?有可参考的文档不