Text Generation
Transformers
PyTorch
Chinese
English
llama
conversational
custom_code
text-generation-inference
Run this model with HF Jobs
Run openbmb/BitCPM-CANN-1B-unquantized on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/openbmb/BitCPM-CANN-1B-unquantized. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/openbmb/BitCPM-CANN-1B-unquantized on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/openbmb/BitCPM-CANN-1B-unquantized. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/openbmb/BitCPM-CANN-1B-unquantized. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
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
Upload config.json with huggingface_hub
Browse files8 unmodified lines91011121314158 unmodified lines242526272829303132333435368 unmodified lines"AutoModelForCausalLM": "modeling_llama.LlamaForCausalLM"},"bos_token_id": 1,"eos_token_id": [2,73440],"pad_token_id": 2,"hidden_act": "silu","hidden_size": 2048,8 unmodified lines"rms_norm_eps": 1e-06,"rope_scaling": {"factor": 1.0,"rope_type": "longrope","long_factor": [0.9977997200264581, 1.014658295992452, 1.0349680404997148, 1.059429246056193, 1.0888815016813513, 1.1243301355211495, 1.166977103606075, 1.2182568066927284, 1.2798772354275727, 1.3538666751582975, 1.4426259039919596, 1.5489853358570191, 1.6762658237220625, 1.8283407612492941, 2.0096956085876183, 2.225478927469756, 2.481536379650452, 2.784415934557119, 3.1413289096347365, 3.560047844772632, 4.048719380066383, 4.615569542115128, 5.2684819496549835, 6.014438591970396, 6.858830049237097, 7.804668263503327, 8.851768731513417, 9.99600492938444, 11.228766118181639, 12.536757560834843, 13.902257701387796, 15.303885189125953, 16.717837610115794, 18.119465097853947, 19.484965238406907, 20.792956681060105, 22.02571786985731, 23.16995406772833, 24.217054535738416, 25.16289275000465, 26.007284207271347, 26.753240849586767, 27.40615325712662, 27.973003419175363, 28.461674954469114, 28.880393889607006, 29.237306864684626, 29.540186419591297, 29.79624387177199, 30.01202719065413, 30.193382037992453, 30.34545697551969, 30.47273746338473, 30.579096895249787, 30.66785612408345, 30.741845563814174, 30.80346599254902, 30.85474569563567, 30.897392663720595, 30.932841297560394, 30.962293553185553, 30.986754758742034, 31.007064503249293, 31.02392307921529],"short_factor": [0.9977997200264581, 1.014658295992452, 1.0349680404997148, 1.059429246056193, 1.0888815016813513, 1.1243301355211495, 1.166977103606075, 1.2182568066927284, 1.2798772354275727, 1.3538666751582975, 1.4426259039919596, 1.5489853358570191, 1.6762658237220625, 1.8283407612492941, 2.0096956085876183, 2.225478927469756, 2.481536379650452, 2.784415934557119, 3.1413289096347365, 3.560047844772632, 4.048719380066383, 4.615569542115128, 5.2684819496549835, 6.014438591970396, 6.858830049237097, 7.804668263503327, 8.851768731513417, 9.99600492938444, 11.228766118181639, 12.536757560834843, 13.902257701387796, 15.303885189125953, 16.717837610115794, 18.119465097853947, 19.484965238406907, 20.792956681060105, 22.02571786985731, 23.16995406772833, 24.217054535738416, 25.16289275000465, 26.007284207271347, 26.753240849586767, 27.40615325712662, 27.973003419175363, 28.461674954469114, 28.880393889607006, 29.237306864684626, 29.540186419591297, 29.79624387177199, 30.01202719065413, 30.193382037992453, 30.34545697551969, 30.47273746338473, 30.579096895249787, 30.66785612408345, 30.741845563814174, 30.80346599254902, 30.85474569563567, 30.897392663720595, 30.932841297560394, 30.962293553185553, 30.986754758742034, 31.007064503249293, 31.02392307921529],"original_max_position_embeddings": 32768},"torch_dtype": "bfloat16","transformers_version": "4.36.0","use_cache": true,"vocab_size": 73448}8 unmodified lines91011121314151617188 unmodified lines272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681698 unmodified lines"AutoModelForCausalLM": "modeling_llama.LlamaForCausalLM"},"bos_token_id": 1,"eos_token_id": [2,73440],"pad_token_id": 2,"hidden_act": "silu","hidden_size": 2048,8 unmodified lines"rms_norm_eps": 1e-06,"rope_scaling": {"factor": 1.0,"rope_type": "longrope","long_factor": [0.9977997200264581,1.014658295992452,1.0349680404997148,1.059429246056193,1.0888815016813513,1.1243301355211495,1.166977103606075,1.2182568066927284,1.2798772354275727,1.3538666751582975,1.4426259039919596,1.5489853358570191,1.6762658237220625,1.8283407612492941,2.0096956085876183,2.225478927469756,2.481536379650452,2.784415934557119,3.1413289096347365,3.560047844772632,4.048719380066383,4.615569542115128,5.2684819496549835,6.014438591970396,6.858830049237097,7.804668263503327,8.851768731513417,9.99600492938444,11.228766118181639,12.536757560834843,13.902257701387796,15.303885189125953,16.717837610115794,18.119465097853947,19.484965238406907,20.792956681060105,22.02571786985731,23.16995406772833,24.217054535738416,25.16289275000465,26.007284207271347,26.753240849586767,27.40615325712662,27.973003419175363,28.461674954469114,28.880393889607006,29.237306864684626,29.540186419591297,29.79624387177199,30.01202719065413,30.193382037992453,30.34545697551969,30.47273746338473,30.579096895249787,30.66785612408345,30.741845563814174,30.80346599254902,30.85474569563567,30.897392663720595,30.932841297560394,30.962293553185553,30.986754758742034,31.007064503249293,31.02392307921529],"short_factor": [0.9977997200264581,1.014658295992452,1.0349680404997148,1.059429246056193,1.0888815016813513,1.1243301355211495,1.166977103606075,1.2182568066927284,1.2798772354275727,1.3538666751582975,1.4426259039919596,1.5489853358570191,1.6762658237220625,1.8283407612492941,2.0096956085876183,2.225478927469756,2.481536379650452,2.784415934557119,3.1413289096347365,3.560047844772632,4.048719380066383,4.615569542115128,5.2684819496549835,6.014438591970396,6.858830049237097,7.804668263503327,8.851768731513417,9.99600492938444,11.228766118181639,12.536757560834843,13.902257701387796,15.303885189125953,16.717837610115794,18.119465097853947,19.484965238406907,20.792956681060105,22.02571786985731,23.16995406772833,24.217054535738416,25.16289275000465,26.007284207271347,26.753240849586767,27.40615325712662,27.973003419175363,28.461674954469114,28.880393889607006,29.237306864684626,29.540186419591297,29.79624387177199,30.01202719065413,30.193382037992453,30.34545697551969,30.47273746338473,30.579096895249787,30.66785612408345,30.741845563814174,30.80346599254902,30.85474569563567,30.897392663720595,30.932841297560394,30.962293553185553,30.986754758742034,31.007064503249293,31.02392307921529],"original_max_position_embeddings": 32768},"torch_dtype": "bfloat16","transformers_version": "4.46.3","use_cache": true,"vocab_size": 73448}
config.json+139-6