Instructions to use openbmb/BitCPM-CANN-8B-unquantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/BitCPM-CANN-8B-unquantized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/BitCPM-CANN-8B-unquantized", 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/BitCPM-CANN-8B-unquantized", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use openbmb/BitCPM-CANN-8B-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-8B-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-8B-unquantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/BitCPM-CANN-8B-unquantized
- SGLang
How to use openbmb/BitCPM-CANN-8B-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-8B-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-8B-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-8B-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-8B-unquantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/BitCPM-CANN-8B-unquantized with Docker Model Runner:
docker model run hf.co/openbmb/BitCPM-CANN-8B-unquantized
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -20,9 +20,9 @@ library_name: transformers
|
|
| 20 |
|
| 21 |
## Introduction
|
| 22 |
|
| 23 |
-
BitCPM4-CANN-
|
| 24 |
|
| 25 |
-
> β οΈ **This model is NOT intended for direct inference.** It is designed as the starting point for fine-tuning BitCPM4-CANN. If you need a model for inference, please use the pseudo-quantized version: [openbmb/BitCPM4-CANN-
|
| 26 |
|
| 27 |
### Key Characteristics
|
| 28 |
|
|
@@ -47,7 +47,7 @@ This model is designed for fine-tuning with frameworks that support custom model
|
|
| 47 |
|
| 48 |
#### Supported Fine-tuning Frameworks
|
| 49 |
|
| 50 |
-
- **DeepSpeed** (recommended): See [example](https://huggingface.co/openbmb/BitCPM4-CANN-
|
| 51 |
- **LLaMA Factory**: Supports custom model loading with `trust_remote_code=True`
|
| 52 |
- **Other Frameworks**: Any framework that supports HuggingFace-compatible model loading with custom modeling code
|
| 53 |
|
|
@@ -60,7 +60,7 @@ When fine-tuning, you **must** ensure:
|
|
| 60 |
```python
|
| 61 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 62 |
|
| 63 |
-
path = 'openbmb/BitCPM4-CANN-
|
| 64 |
tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True)
|
| 65 |
model = AutoModelForCausalLM.from_pretrained(
|
| 66 |
path,
|
|
@@ -90,7 +90,7 @@ The converted model can then be loaded for inference in the same way as [openbmb
|
|
| 90 |
|
| 91 |
```
|
| 92 |
βββββββββββββββββββββββββββββββββββ
|
| 93 |
-
β BitCPM4-CANN-
|
| 94 |
βββββββββββββββββ¬ββββββββββββββββββ
|
| 95 |
β
|
| 96 |
βΌ Fine-tune (DeepSpeed / LLaMA Factory / ...)
|
|
|
|
| 20 |
|
| 21 |
## Introduction
|
| 22 |
|
| 23 |
+
BitCPM4-CANN-8B-unquantized is the **unquantized QAT training checkpoint** of the BitCPM4-CANN-8B model. This model stores the raw quantization-aware training (QAT) parameters **before** fake-quantizer fusionβthe ternary fake quantizers are defined in `modeling.py` and applied during forward propagation.
|
| 24 |
|
| 25 |
+
> β οΈ **This model is NOT intended for direct inference.** It is designed as the starting point for fine-tuning BitCPM4-CANN. If you need a model for inference, please use the pseudo-quantized version: [openbmb/BitCPM4-CANN-8B](https://huggingface.co/openbmb/BitCPM4-CANN-8B).
|
| 26 |
|
| 27 |
### Key Characteristics
|
| 28 |
|
|
|
|
| 47 |
|
| 48 |
#### Supported Fine-tuning Frameworks
|
| 49 |
|
| 50 |
+
- **DeepSpeed** (recommended): See [example](https://huggingface.co/openbmb/BitCPM4-CANN-8B-unquantized/tree/main/example)
|
| 51 |
- **LLaMA Factory**: Supports custom model loading with `trust_remote_code=True`
|
| 52 |
- **Other Frameworks**: Any framework that supports HuggingFace-compatible model loading with custom modeling code
|
| 53 |
|
|
|
|
| 60 |
```python
|
| 61 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 62 |
|
| 63 |
+
path = 'openbmb/BitCPM4-CANN-8B-unquantized'
|
| 64 |
tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True)
|
| 65 |
model = AutoModelForCausalLM.from_pretrained(
|
| 66 |
path,
|
|
|
|
| 90 |
|
| 91 |
```
|
| 92 |
βββββββββββββββββββββββββββββββββββ
|
| 93 |
+
β BitCPM4-CANN-8B-unquantized β β This model (QAT parameters + fake quantizer in modeling.py)
|
| 94 |
βββββββββββββββββ¬ββββββββββββββββββ
|
| 95 |
β
|
| 96 |
βΌ Fine-tune (DeepSpeed / LLaMA Factory / ...)
|