Text Generation
Transformers
PyTorch
Chinese
English
llama
conversational
custom_code
text-generation-inference
Instructions to use openbmb/BitCPM-CANN-1B-unquantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/BitCPM-CANN-1B-unquantized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/BitCPM-CANN-1B-unquantized", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("openbmb/BitCPM-CANN-1B-unquantized", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("openbmb/BitCPM-CANN-1B-unquantized", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/BitCPM-CANN-1B-unquantized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/BitCPM-CANN-1B-unquantized" # 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/BitCPM-CANN-1B-unquantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/BitCPM-CANN-1B-unquantized
- SGLang
How to use openbmb/BitCPM-CANN-1B-unquantized 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/BitCPM-CANN-1B-unquantized" \ --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/BitCPM-CANN-1B-unquantized", "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/BitCPM-CANN-1B-unquantized" \ --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/BitCPM-CANN-1B-unquantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/BitCPM-CANN-1B-unquantized with Docker Model Runner:
docker model run hf.co/openbmb/BitCPM-CANN-1B-unquantized
Commit History
-
Adding `safetensors` variant of this model
Verified signatureThis is an automated PR created with https://huggingface.co/spaces/safetensors/convert This new file is equivalent to `pytorch_model.bin` but safe in the sense that no arbitrary code can be put into it. These files also happen to load much faster than their pytorch counterpart: https://colab.research.google.com/github/huggingface/notebooks/blob/main/safetensors_doc/en/speed.ipynb The widgets on your model page will run using this model even if this is not merged making sure the file actually works. If you find any issues: please report here: https://huggingface.co/spaces/safetensors/convert/discussions Feel free to ignore this PR.a067e48
-
Update example naming from BitCPM4 to BitCPM
Verified signature76bad5d -
Update example naming from BitCPM4 to BitCPM
Verified signature4e39089 -
Update example naming from BitCPM4 to BitCPM
Verified signature309e7bb -
Update README naming from BitCPM4 to BitCPM
Verified signatureb7d219e
-
Update example/README.md
Verified signature11c4439 -
Upload folder using huggingface_hub
Verified signature413f4f3 -
Upload README.md with huggingface_hub
Verified signaturecc733b5 -
Upload README.md with huggingface_hub
Verified signature68beec3 -
Upload README.md with huggingface_hub
Verified signaturea415ed2 -
Upload README.md with huggingface_hub
Verified signature79133af -
Fix example link: use tree/main/example for directory path
Verified signature2674e07 -
Upload README.md with huggingface_hub
Verified signaturefaf784a -
Restore original model README.md (was overwritten by example README)
Verified signature385a63a -
Remove misplaced files from root (moved to example/)
Verified signaturebd0861d -
Add example/ folder with training scripts
Verified signatured7bc7ce -
Upload README.md with huggingface_hub
Verified signature8a5049d -
Upload folder using huggingface_hub
Verified signature31610ea -
Upload config.json with huggingface_hub
Verified signatured99c09f -
Upload configuration_llama.py with huggingface_hub
Verified signature5f9e13c -
Upload modeling_llama.py with huggingface_hub
Verified signaturef9007d7
-
Update modeling_llama.py
Verified signature8b7525a
-
Upload pytorch_model.bin with huggingface_hub
Verified signature3f7ae16 -
Upload config.json with huggingface_hub
Verified signature60238a0
-
Update README.md
Verified signaturef7090a8 -
Update README.md
Verified signature17f0d0e -
Create README.md
Verified signaturee99b139 -
Upload qat-convert.py with huggingface_hub
Verified signature689ba6e -
Upload folder using huggingface_hub
Verified signature33d53a0 -
initial commit
Verified signatureef1e3f1