Instructions to use fireballoon/baichuan-llama-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fireballoon/baichuan-llama-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fireballoon/baichuan-llama-7b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fireballoon/baichuan-llama-7b") model = AutoModelForCausalLM.from_pretrained("fireballoon/baichuan-llama-7b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use fireballoon/baichuan-llama-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fireballoon/baichuan-llama-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-llama-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fireballoon/baichuan-llama-7b
- SGLang
How to use fireballoon/baichuan-llama-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-llama-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-llama-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-llama-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-llama-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fireballoon/baichuan-llama-7b with Docker Model Runner:
docker model run hf.co/fireballoon/baichuan-llama-7b
请问验证过转完的llama格式权重能够用于sft吗
请问验证过转完的llama格式权重能够用于sft吗
可以的。转换之后的模型和llama是一样的,所有支持llama的代码都可以直接使用。
我使用转换后的模型已经成功训练了sft模型:baichuan-vicuna-7b, baichuan-vicuna-chinese-7b。
可以的。转换之后的模型和llama是一样的,所有支持llama的代码都可以直接使用。
我使用转换后的模型已经成功训练了sft模型:baichuan-vicuna-7b, baichuan-vicuna-chinese-7b。
请问使用这个模型做sft和baichuan官方的有什么区别?只是lora的module name不一样吗?
对。本模型只是把baichuan的w_pack恢复回了llama的qkv矩阵,其他未做任何改动。转化代码:https://huggingface.co/fireballoon/baichuan-llama-7b/blob/main/convert_baichuan_to_llama.py
训练超参数设置成训练llama-7b的参数就行。
请问用https://github.com/hiyouga/LLaMA-Factory 训练这个fireballoon/baichuan-llama-7b会报错是什么原因呢:
File "/home/tiger/.local/lib/python3.9/site-packages/peft/tuners/lora/layer.py", line 296, in _linear
return F.linear(input, transpose(self.weight, self.fan_in_fan_out), bias=self.bias)
RuntimeError: CUDA error: CUBLAS_STATUS_NOT_INITIALIZED when calling cublasCreate(handle)
../aten/src/ATen/native/cuda/Indexing.cu:1292: indexSelectLargeIndex: block: [486,0,0], thread: [32,0,0] Assertion srcIndex < srcSelectDimSize failed.