Views
No views yet
unsloth/qwen2.5-3b-instruct-unsloth-bnb-4bit using Parameter-Efficient Fine-Tuning (PEFT) with the LoRA method.1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3
4tokenizer = AutoTokenizer.from_pretrained("unsloth/qwen2.5-3b-instruct-unsloth-bnb-4bit")
5base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen2.5-3b-instruct-unsloth-bnb-4bit")
6
7# Load LoRA adapter
8model = PeftModel.from_pretrained(base_model, "path_to_your_adapter")
9
10# Example inference
11input_text = "Your input text here."
12inputs = tokenizer(input_text, return_tensors="pt")
13outputs = model.generate(**inputs)
14print(tokenizer.decode(outputs[0]))lora_alpha: 64r: 64target_modules: ['v_proj', 'o_proj', 'up_proj', 'gate_proj', 'down_proj', 'q_proj', 'k_proj']bias: none@misc{your2025model,
title={Qwen2.5-3B-Instruct with LoRA Adapter},
author={Kenneth Hamilton},
year={2025}
}