Instructions to use fireballoon/baichuan-vicuna-chinese-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fireballoon/baichuan-vicuna-chinese-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fireballoon/baichuan-vicuna-chinese-7b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fireballoon/baichuan-vicuna-chinese-7b") model = AutoModelForCausalLM.from_pretrained("fireballoon/baichuan-vicuna-chinese-7b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fireballoon/baichuan-vicuna-chinese-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-chinese-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-chinese-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fireballoon/baichuan-vicuna-chinese-7b
- SGLang
How to use fireballoon/baichuan-vicuna-chinese-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-chinese-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-chinese-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-chinese-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-chinese-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fireballoon/baichuan-vicuna-chinese-7b with Docker Model Runner:
docker model run hf.co/fireballoon/baichuan-vicuna-chinese-7b
loss震荡幅度比较大是正常的嘛,loss是在3个epoch的哪个时候开始下降并保持稳定的呢
#13
by Aibet - opened
我的训练还是挺稳定的。一直都在稳定下降。
图中的loss是单个数据的还是一个batch (32条数据)的平均?
我这个是单用一个数据集做的训练,然后波动比较大。请问,这是否和您ft代码里的那个mix_data有关,因为并没有看到实际的数据mix的代码调用,可以提供一下这块的代码嘛?谢谢
我在loss计算时候是使用的100个batch的平均,所以可能看上去比较稳定。我没检查每个batch的loss的波动。
mix data是用于平衡不同数据的采样比例。由于leetcode数据比较少,我在训练模型(https://huggingface.co/fireballoon/baichuan-vicuna-chinese-7b )把leetcode数据的采样率提高到了2倍(即每个epoch会过2遍leetcode数据)。其他数据采样率都是1,即1epoch过一遍。
