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)# 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) 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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
Upload config.json with huggingface_hub
Browse files- config.json +139 -6
config.json
CHANGED
|
@@ -9,7 +9,10 @@
|
|
| 9 |
"AutoModelForCausalLM": "modeling_llama.LlamaForCausalLM"
|
| 10 |
},
|
| 11 |
"bos_token_id": 1,
|
| 12 |
-
"eos_token_id": [
|
|
|
|
|
|
|
|
|
|
| 13 |
"pad_token_id": 2,
|
| 14 |
"hidden_act": "silu",
|
| 15 |
"hidden_size": 2048,
|
|
@@ -24,13 +27,143 @@
|
|
| 24 |
"rms_norm_eps": 1e-06,
|
| 25 |
"rope_scaling": {
|
| 26 |
"factor": 1.0,
|
| 27 |
-
"rope_type": "longrope",
|
| 28 |
-
"long_factor": [
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
},
|
| 32 |
"torch_dtype": "bfloat16",
|
| 33 |
-
"transformers_version": "4.
|
| 34 |
"use_cache": true,
|
| 35 |
"vocab_size": 73448
|
| 36 |
}
|
|
|
|
| 9 |
"AutoModelForCausalLM": "modeling_llama.LlamaForCausalLM"
|
| 10 |
},
|
| 11 |
"bos_token_id": 1,
|
| 12 |
+
"eos_token_id": [
|
| 13 |
+
2,
|
| 14 |
+
73440
|
| 15 |
+
],
|
| 16 |
"pad_token_id": 2,
|
| 17 |
"hidden_act": "silu",
|
| 18 |
"hidden_size": 2048,
|
|
|
|
| 27 |
"rms_norm_eps": 1e-06,
|
| 28 |
"rope_scaling": {
|
| 29 |
"factor": 1.0,
|
| 30 |
+
"rope_type": "longrope",
|
| 31 |
+
"long_factor": [
|
| 32 |
+
0.9977997200264581,
|
| 33 |
+
1.014658295992452,
|
| 34 |
+
1.0349680404997148,
|
| 35 |
+
1.059429246056193,
|
| 36 |
+
1.0888815016813513,
|
| 37 |
+
1.1243301355211495,
|
| 38 |
+
1.166977103606075,
|
| 39 |
+
1.2182568066927284,
|
| 40 |
+
1.2798772354275727,
|
| 41 |
+
1.3538666751582975,
|
| 42 |
+
1.4426259039919596,
|
| 43 |
+
1.5489853358570191,
|
| 44 |
+
1.6762658237220625,
|
| 45 |
+
1.8283407612492941,
|
| 46 |
+
2.0096956085876183,
|
| 47 |
+
2.225478927469756,
|
| 48 |
+
2.481536379650452,
|
| 49 |
+
2.784415934557119,
|
| 50 |
+
3.1413289096347365,
|
| 51 |
+
3.560047844772632,
|
| 52 |
+
4.048719380066383,
|
| 53 |
+
4.615569542115128,
|
| 54 |
+
5.2684819496549835,
|
| 55 |
+
6.014438591970396,
|
| 56 |
+
6.858830049237097,
|
| 57 |
+
7.804668263503327,
|
| 58 |
+
8.851768731513417,
|
| 59 |
+
9.99600492938444,
|
| 60 |
+
11.228766118181639,
|
| 61 |
+
12.536757560834843,
|
| 62 |
+
13.902257701387796,
|
| 63 |
+
15.303885189125953,
|
| 64 |
+
16.717837610115794,
|
| 65 |
+
18.119465097853947,
|
| 66 |
+
19.484965238406907,
|
| 67 |
+
20.792956681060105,
|
| 68 |
+
22.02571786985731,
|
| 69 |
+
23.16995406772833,
|
| 70 |
+
24.217054535738416,
|
| 71 |
+
25.16289275000465,
|
| 72 |
+
26.007284207271347,
|
| 73 |
+
26.753240849586767,
|
| 74 |
+
27.40615325712662,
|
| 75 |
+
27.973003419175363,
|
| 76 |
+
28.461674954469114,
|
| 77 |
+
28.880393889607006,
|
| 78 |
+
29.237306864684626,
|
| 79 |
+
29.540186419591297,
|
| 80 |
+
29.79624387177199,
|
| 81 |
+
30.01202719065413,
|
| 82 |
+
30.193382037992453,
|
| 83 |
+
30.34545697551969,
|
| 84 |
+
30.47273746338473,
|
| 85 |
+
30.579096895249787,
|
| 86 |
+
30.66785612408345,
|
| 87 |
+
30.741845563814174,
|
| 88 |
+
30.80346599254902,
|
| 89 |
+
30.85474569563567,
|
| 90 |
+
30.897392663720595,
|
| 91 |
+
30.932841297560394,
|
| 92 |
+
30.962293553185553,
|
| 93 |
+
30.986754758742034,
|
| 94 |
+
31.007064503249293,
|
| 95 |
+
31.02392307921529
|
| 96 |
+
],
|
| 97 |
+
"short_factor": [
|
| 98 |
+
0.9977997200264581,
|
| 99 |
+
1.014658295992452,
|
| 100 |
+
1.0349680404997148,
|
| 101 |
+
1.059429246056193,
|
| 102 |
+
1.0888815016813513,
|
| 103 |
+
1.1243301355211495,
|
| 104 |
+
1.166977103606075,
|
| 105 |
+
1.2182568066927284,
|
| 106 |
+
1.2798772354275727,
|
| 107 |
+
1.3538666751582975,
|
| 108 |
+
1.4426259039919596,
|
| 109 |
+
1.5489853358570191,
|
| 110 |
+
1.6762658237220625,
|
| 111 |
+
1.8283407612492941,
|
| 112 |
+
2.0096956085876183,
|
| 113 |
+
2.225478927469756,
|
| 114 |
+
2.481536379650452,
|
| 115 |
+
2.784415934557119,
|
| 116 |
+
3.1413289096347365,
|
| 117 |
+
3.560047844772632,
|
| 118 |
+
4.048719380066383,
|
| 119 |
+
4.615569542115128,
|
| 120 |
+
5.2684819496549835,
|
| 121 |
+
6.014438591970396,
|
| 122 |
+
6.858830049237097,
|
| 123 |
+
7.804668263503327,
|
| 124 |
+
8.851768731513417,
|
| 125 |
+
9.99600492938444,
|
| 126 |
+
11.228766118181639,
|
| 127 |
+
12.536757560834843,
|
| 128 |
+
13.902257701387796,
|
| 129 |
+
15.303885189125953,
|
| 130 |
+
16.717837610115794,
|
| 131 |
+
18.119465097853947,
|
| 132 |
+
19.484965238406907,
|
| 133 |
+
20.792956681060105,
|
| 134 |
+
22.02571786985731,
|
| 135 |
+
23.16995406772833,
|
| 136 |
+
24.217054535738416,
|
| 137 |
+
25.16289275000465,
|
| 138 |
+
26.007284207271347,
|
| 139 |
+
26.753240849586767,
|
| 140 |
+
27.40615325712662,
|
| 141 |
+
27.973003419175363,
|
| 142 |
+
28.461674954469114,
|
| 143 |
+
28.880393889607006,
|
| 144 |
+
29.237306864684626,
|
| 145 |
+
29.540186419591297,
|
| 146 |
+
29.79624387177199,
|
| 147 |
+
30.01202719065413,
|
| 148 |
+
30.193382037992453,
|
| 149 |
+
30.34545697551969,
|
| 150 |
+
30.47273746338473,
|
| 151 |
+
30.579096895249787,
|
| 152 |
+
30.66785612408345,
|
| 153 |
+
30.741845563814174,
|
| 154 |
+
30.80346599254902,
|
| 155 |
+
30.85474569563567,
|
| 156 |
+
30.897392663720595,
|
| 157 |
+
30.932841297560394,
|
| 158 |
+
30.962293553185553,
|
| 159 |
+
30.986754758742034,
|
| 160 |
+
31.007064503249293,
|
| 161 |
+
31.02392307921529
|
| 162 |
+
],
|
| 163 |
+
"original_max_position_embeddings": 32768
|
| 164 |
},
|
| 165 |
"torch_dtype": "bfloat16",
|
| 166 |
+
"transformers_version": "4.46.3",
|
| 167 |
"use_cache": true,
|
| 168 |
"vocab_size": 73448
|
| 169 |
}
|