Instructions to use QuixiAI/samantha-yi-34b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QuixiAI/samantha-yi-34b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="QuixiAI/samantha-yi-34b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("QuixiAI/samantha-yi-34b") model = AutoModelForCausalLM.from_pretrained("QuixiAI/samantha-yi-34b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use QuixiAI/samantha-yi-34b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuixiAI/samantha-yi-34b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuixiAI/samantha-yi-34b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuixiAI/samantha-yi-34b
- SGLang
How to use QuixiAI/samantha-yi-34b 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 "QuixiAI/samantha-yi-34b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuixiAI/samantha-yi-34b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "QuixiAI/samantha-yi-34b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuixiAI/samantha-yi-34b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use QuixiAI/samantha-yi-34b with Docker Model Runner:
docker model run hf.co/QuixiAI/samantha-yi-34b
A question about lora_r and lora_alpha configuration
Thanks for your excellent work @ehartford
Last week I read an article on fine-tuning: Finetuning LLMs with LoRA and QLoRA: Insights from Hundreds of Experim, In it:
"As a rule of thumb, it’s usually common to choose an alpha that is twice as large as the rank when finetuning LLMs (note that this is different when working with diffusion models). Let’s try this out and see what happens when we increase alpha two-fold"

I noticed you set the lora_r=32 and lora_alpha=16 in the axolotl yml file, which didn't comply with the common rule. May I know the reason behind it? I'm just curious about it.
Thanks and have a nice day!
I actually don't know!
I could train it again with another setting if you think it would give better results.
I saw the llama2 example in Axolotl has the same settings.
The article I mentioned compares two settings: "lora_r=32, lora_alpha=64" with "lora_r=32, lora_alpha=1". The result of the first one is better than previous one.
But the article didn't mention detail procedures among tests, it's hard to say the results are statistically significant.
I tested smaller models under 7B, the results are not significant. However, since the models themself are weak, it can not prove if those settings are useful.
I didn't have enough resources to test them on 34B or bigger ones. If you have time and resources, it's appreciated if you can test the "lora_r=32, lora_alpha=64" on new trainings to check if they can get better scores on leaderboard.
Thanks and have a nice day!