Instructions to use baichuan-inc/Baichuan2-7B-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use baichuan-inc/Baichuan2-7B-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="baichuan-inc/Baichuan2-7B-Chat", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("baichuan-inc/Baichuan2-7B-Chat", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use baichuan-inc/Baichuan2-7B-Chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "baichuan-inc/Baichuan2-7B-Chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "baichuan-inc/Baichuan2-7B-Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/baichuan-inc/Baichuan2-7B-Chat
- SGLang
How to use baichuan-inc/Baichuan2-7B-Chat 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 "baichuan-inc/Baichuan2-7B-Chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "baichuan-inc/Baichuan2-7B-Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "baichuan-inc/Baichuan2-7B-Chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "baichuan-inc/Baichuan2-7B-Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use baichuan-inc/Baichuan2-7B-Chat with Docker Model Runner:
docker model run hf.co/baichuan-inc/Baichuan2-7B-Chat
Update modeling_baichuan.py to handle empty Transformers cache objects in generation
#20 opened 5 months ago
by
sylwia-kuros
Adding `safetensors` variant of this model
#19 opened about 1 year ago
by
aber123
Adding `safetensors` variant of this model
#18 opened about 1 year ago
by
aber123
🚩 Report: Ethical issue(s)
#17 opened about 2 years ago
by
yytest11
Request: DOI
#16 opened about 2 years ago
by
HuiDong1
Huggingface-cli downloads "baichuan-inc/Baichuan2-7B-Chat" failed with error: Distant resource does not have a Content-Length
#15 opened about 2 years ago
by
yzha107
Introducing AutoRound int4 algoirhtm
🚀 1
#14 opened over 2 years ago
by
wenhuach
Adding `safetensors` variant of this model
#13 opened over 2 years ago
by
SFconvertbot
有人遇到这个问题吗?
#12 opened over 2 years ago
by
zkyool
another error in data cleaning
#10 opened over 2 years ago
by
J22
how to use batch inference just like llama2?
#9 opened almost 3 years ago
by
daisr
百川2大模型推理卡顿、阻塞问题
#7 opened almost 3 years ago
by
daisr
Adding `safetensors` variant of this model
#6 opened almost 3 years ago
by
shaoyong
Add more precise license metadata (UI will be cleaner!)
❤️ 1
#5 opened almost 3 years ago
by
osanseviero
NormHead 中的分支判断
2
#3 opened about 3 years ago
by
JaheimLee
chat版模型和base版模型的差异具体体现在哪些方面?
#1 opened about 3 years ago
by
someone652314