Instructions to use openbmb/cpm-bee-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/cpm-bee-1b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/cpm-bee-1b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openbmb/cpm-bee-1b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/cpm-bee-1b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/cpm-bee-1b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/cpm-bee-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/openbmb/cpm-bee-1b
- SGLang
How to use openbmb/cpm-bee-1b 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/cpm-bee-1b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/cpm-bee-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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/cpm-bee-1b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/cpm-bee-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use openbmb/cpm-bee-1b with Docker Model Runner:
docker model run hf.co/openbmb/cpm-bee-1b
Commit History
-
Update README.md
Verified signature1036980
-
fix normal token with <>
Gong Baitao8da2f35
-
fix repetition penalty
Gong Baitao190abe7
-
Update modeling_cpmbee.py for max_length
Gong Baitao1ddbefc -
Update generation_config.json
9575b6b
-
Update modeling_cpmbee.py and README.md
Gong Baitao9542344 -
add README.md
Gong Baitaoa5af69e -
Update tokenization_cpmbee.py
Gong Baitao8ea0ba9 -
Update modeling_cpmbee.py
Gong Baitao02b2bad -
Upload modeling_cpmbee.py
4a399fc
-
Upload modeling_cpmbee.py
a2b1e3e
-
Update modeling_cpmbee.py
9d1f20b -
Create generation_config.json
7ef4e43 -
Update tokenizer_config.json
2f51710 -
Create tokenizer_config.json
fd507f5 -
Update config.json
25efb04 -
Update tokenization_cpmbee.py
c4cb5b6 -
Update modeling_cpmbee.py
3cc9b7a -
Update configuration_cpmbee.py
edc4347 -
Update config.json
1a8d9c8 -
Update config.json
0e55197 -
add source files
83e21b6 -
Update config.json
b197fa6
-
Init cpm-bee-1b
bd72a61 -
initial commit
39c7e8f