Instructions to use fireballoon/baichuan-vicuna-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fireballoon/baichuan-vicuna-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fireballoon/baichuan-vicuna-7b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fireballoon/baichuan-vicuna-7b") model = AutoModelForCausalLM.from_pretrained("fireballoon/baichuan-vicuna-7b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use fireballoon/baichuan-vicuna-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fireballoon/baichuan-vicuna-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fireballoon/baichuan-vicuna-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fireballoon/baichuan-vicuna-7b
- SGLang
How to use fireballoon/baichuan-vicuna-7b 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 "fireballoon/baichuan-vicuna-7b" \ --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": "fireballoon/baichuan-vicuna-7b", "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 "fireballoon/baichuan-vicuna-7b" \ --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": "fireballoon/baichuan-vicuna-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fireballoon/baichuan-vicuna-7b with Docker Model Runner:
docker model run hf.co/fireballoon/baichuan-vicuna-7b
关于模型中文语言表现
#6
by reedhs - opened
感谢作者的工作!
想请教一下,目前我看到您的instruction fintuning 语料主要都是英文语料,但是中文输出效果尚可,因此有一个疑问:之前使用 LLama vicuna-7b 时常会出现中文问、模型英文回答的情况,感觉原因是英文的finetune过多导致(当然和llama本身也有关系),不知道这种现象在本模型使用中是否常出现?或者说您采用了什么办法来减少或避免此问题?谢谢!
- 本模型会出现问中文回答英文的问题,在一些特点问题上比较频繁。
- ShareGPT中有一定比例的中文数据,baichuan-7b也在更多中文语料上训练,可能有助于缓解这个问题。
- 避免此问题可以在更多中文问中文答的数据上微调。