Instructions to use baichuan-inc/Baichuan2-13B-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use baichuan-inc/Baichuan2-13B-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="baichuan-inc/Baichuan2-13B-Chat", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("baichuan-inc/Baichuan2-13B-Chat", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use baichuan-inc/Baichuan2-13B-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-13B-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-13B-Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/baichuan-inc/Baichuan2-13B-Chat
- SGLang
How to use baichuan-inc/Baichuan2-13B-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-13B-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-13B-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-13B-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-13B-Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use baichuan-inc/Baichuan2-13B-Chat with Docker Model Runner:
docker model run hf.co/baichuan-inc/Baichuan2-13B-Chat
read
#43 opened over 1 year ago
by
Angel522776
Interview request: genAI evaluation & documentation
#42 opened almost 2 years ago
by
meggymuggy
Update README.md
#41 opened almost 2 years ago
by
xianfeng6666
Deos baichuan2_13B_chat support function calling ?
#40 opened over 2 years ago
by
daisr
Fast tokenizer
#39 opened over 2 years ago
by
soominc
使用哪个加速推理框架比较好?
1
#38 opened over 2 years ago
by
daisr
Adding `safetensors` variant of this model
#37 opened over 2 years ago
by
SFconvertbot
Can not infer, depolyed Baichuan2-13b-Chat with 2x RTX3090 24G and FastChat.
#36 opened over 2 years ago
by
Rethen
如何流式输出
3
#35 opened over 2 years ago
by
DeyangKong
百川大模型本地量化部署的问题
1
#34 opened over 2 years ago
by
Jason123321123
部署Baichuan2-13b-chat时候使用官网代码推理输出的时候报错
4
#31 opened over 2 years ago
by
lhlnlp
update modeling_baichuan.py for torchscript mode with past_kv
#30 opened over 2 years ago
by
changwangss
各位大佬,微调baichuan2-13b后得到pth文件,该如何推理
1
#29 opened over 2 years ago
by
ddq2020
Asking about new version of Baichuan LLM
❤️ 1
#28 opened almost 3 years ago
by
phamvantoan
Update modeling_baichuan.py
1
#27 opened almost 3 years ago
by
ybelkada
Asking about the performance of retrieving local data
#25 opened almost 3 years ago
by
phamvantoan
Asking about prompt template for Baichuan2-13B-Chat
#24 opened almost 3 years ago
by
phamvantoan
AttributeError: 'list' object has no attribute 'as_dict'
1
#23 opened almost 3 years ago
by
RR0825
how to accelerate the inference speed
2
#22 opened almost 3 years ago
by
tobywang
Baichuan 2 192k context length
#21 opened almost 3 years ago
by
Ekolawole
baichuan 192K weight release?
#20 opened almost 3 years ago
by
Yhyu13
AttributeError: 'BaichuanTokenizer' object has no attribute 'sp_model'
8
#18 opened almost 3 years ago
by
lucasjin
关于Alibi位置编码
1
#17 opened almost 3 years ago
by
Hunter1943
百川大模型本地部署
2
#14 opened almost 3 years ago
by
Yuwh07
Update modeling_baichuan.py
#12 opened almost 3 years ago
by
JaheimLee
xops使用与7B模型不一致
#11 opened almost 3 years ago
by
JaheimLee