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
| step,train/loss,train/grad_norm,train/learning_rate,train/epoch,train/train_runtime,train/train_samples_per_second,train/train_steps_per_second,train/total_flos,train/train_loss | |
| 2,2.7920000553131104,0.035306449979543686,7.999999979801942e-06,0.010457516647875309,,,,, | |
| 4,2.8011999130249023,0.03491510450839996,1.5999999959603883e-05,0.020915033295750618,,,,, | |
| 6,2.7964000701904297,0.032717395573854446,2.4000000848900527e-05,0.0313725508749485,,,,, | |
| 8,2.763700008392334,0.024953875690698624,3.199999991920777e-05,0.041830066591501236,,,,, | |
| 10,3.2811999320983887,0.3170815408229828,3.9999998989515007e-05,0.05228758230805397,,,,, | |
| 12,2.9409000873565674,0.04423849284648895,3.995128281530924e-05,0.062745101749897,,,,, | |
| 14,2.851900100708008,0.03667925298213959,3.9805359847377986e-05,0.07320261746644974,,,,, | |
| 16,2.7869999408721924,0.022814607247710228,3.9562950405525044e-05,0.08366013318300247,,,,, | |
| 18,2.782599925994873,0.021528413519263268,3.922523319488391e-05,0.0941176488995552,,,,, | |
| 20,2.785599946975708,0.017014438286423683,3.87938525818754e-05,0.10457516461610794,,,,, | |
| 22,2.7571001052856445,0.015719758346676826,3.827090768027119e-05,0.11503268033266068,,,,, | |
| 24,2.762399911880493,0.016948623582720757,3.7658952351193875e-05,0.125490203499794,,,,, | |
| 26,2.7411000728607178,0.015535997226834297,3.6960962461307645e-05,0.13594771921634674,,,,, | |
| 28,2.7330000400543213,0.012748735956847668,3.6180339520797133e-05,0.14640523493289948,,,,, | |
| 30,2.723299980163574,0.014809778891503811,3.532088885549456e-05,0.1568627506494522,,,,, | |
| 32,2.7342000007629395,0.01219236571341753,3.4386797779006884e-05,0.16732026636600494,,,,, | |
| 34,2.7321999073028564,0.012785322032868862,3.338261376484297e-05,0.17777778208255768,,,,, | |
| 36,2.7314000129699707,0.012986919842660427,3.231322989449836e-05,0.1882352977991104,,,,, | |
| 38,2.7065999507904053,0.01096824835985899,3.118385939160362e-05,0.19869281351566315,,,,, | |
| 40,2.6958999633789062,0.012387535534799099,2.9999999242136255e-05,0.20915032923221588,,,,, | |
| 42,2.751499891281128,0.011586200445890427,2.8767422918463126e-05,0.21960784494876862,,,,, | |
| 44,2.713099956512451,0.011821281164884567,2.749213126662653e-05,0.23006536066532135,,,,, | |
| 46,2.7102999687194824,0.01147585827857256,2.6180339773418382e-05,0.24052287638187408,,,,, | |
| 48,2.7019999027252197,0.011368263512849808,2.483843854861334e-05,0.250980406999588,,,,, | |
| 50,2.680500030517578,0.009935515932738781,2.3472963221138343e-05,0.26143792271614075,,,,, | |
| 52,2.6993000507354736,0.0109846917912364,2.2090569473220967e-05,0.2718954384326935,,,,, | |
| 54,2.6940999031066895,0.010465175844728947,2.0697989384643734e-05,0.2823529541492462,,,,, | |
| 56,2.7091000080108643,0.01009758748114109,1.9302009604871273e-05,0.29281046986579895,,,,, | |
| 58,2.69950008392334,0.01249368954449892,1.7909431335283443e-05,0.3032679855823517,,,,, | |
| 60,2.7216999530792236,0.01051376760005951,1.6527035768376663e-05,0.3137255012989044,,,,, | |
| 62,2.7158000469207764,0.01054943073540926,1.516156225989107e-05,0.32418301701545715,,,,, | |
| 64,2.7214999198913574,0.01076149195432663,1.3819660125591327e-05,0.3346405327320099,,,,, | |
| 66,2.7116000652313232,0.010380392894148827,1.2507867722888477e-05,0.3450980484485626,,,,, | |
| 68,2.6923000812530518,0.010425001382827759,1.1232576980546582e-05,0.35555556416511536,,,,, | |
| 70,2.683199882507324,0.00925016961991787,9.999999747378752e-06,0.3660130798816681,,,,, | |
| 72,2.7093000411987305,0.01072422880679369,8.816142326395493e-06,0.3764705955982208,,,,, | |
| 74,2.6988000869750977,0.011063243262469769,7.686770914006047e-06,0.38692811131477356,,,,, | |
| 76,2.7125000953674316,0.01013101264834404,6.61738795315614e-06,0.3973856270313263,,,,, | |
| 78,2.6993000507354736,0.009940676391124725,5.613203938992228e-06,0.40784314274787903,,,,, | |
| 80,2.6861000061035156,0.01050259917974472,4.6791110435151495e-06,0.41830065846443176,,,,, | |
| 82,2.6828999519348145,0.009912634268403053,3.819659923465224e-06,0.4287581741809845,,,,, | |
| 84,2.699199914932251,0.010668900795280933,3.03903811982309e-06,0.43921568989753723,,,,, | |
| 86,2.698899984359741,0.009650414809584618,2.3410482299368596e-06,0.44967320561408997,,,,, | |
| 88,2.6884000301361084,0.01006452739238739,1.7290908544964623e-06,0.4601307213306427,,,,, | |
| 90,2.6928999423980713,0.010409764014184475,1.206147544507985e-06,0.47058823704719543,,,,, | |
| 92,2.714200019836426,0.009937116876244545,7.74766078848188e-07,0.48104575276374817,,,,, | |
| 94,2.672300100326538,0.009728306904435158,4.370479871340649e-07,0.4915032684803009,,,,, | |
| 96,2.7018001079559326,0.010098566301167011,1.9463863054625108e-07,0.501960813999176,,,,, | |
| 98,2.7123000621795654,0.009524320252239704,4.8718995060426096e-08,0.5124183297157288,,,,, | |
| 100,2.7028000354766846,0.009290286339819431,0.0,0.5228758454322815,788.0635986328125,64.96900177001953,0.12700000405311584,4.629706395531346e+17,2.739542245864868 | |