Text Generation
Transformers
PyTorch
Safetensors
English
Chinese
MiniCPM
ModelBest
THUNLP
conversational
custom_code
Instructions to use openbmb/MiniCPM-S-1B-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-S-1B-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM-S-1B-sft", 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-S-1B-sft", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM-S-1B-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM-S-1B-sft" # 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-S-1B-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM-S-1B-sft
- SGLang
How to use openbmb/MiniCPM-S-1B-sft 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-S-1B-sft" \ --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-S-1B-sft", "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-S-1B-sft" \ --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-S-1B-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/MiniCPM-S-1B-sft with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-S-1B-sft
Commit History
-
Adding `safetensors` variant of this model (#1)
Verified signature- Adding `safetensors` variant of this model (f2716729c9c3beb0df1daab75d53ad791c9600ae) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>e46afa6
-
Update tokenizer_config.json
Verified signatureb1b610d
-
Update README.md
Verified signaturef5babc0
-
Update README.md
Verified signature322b1b7 -
Update README.md
Verified signature9b4b61a -
Update README.md
Verified signature867f2d4
-
Update README.md
Verified signaturea35e6e7
-
Update config.json
Verified signatured24fa68 -
Update README.md
Verified signature5e2e5e4 -
Duplicate from SparseLLM/ProSparse-MiniCPM-1B-sft
Verified signaturec5d0768