mlabonne/guanaco-llama2-1k
Viewer • Updated • 1k • 3.29k • 162
How to use parama123/phi3-mini-qlora-guanaco with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
model = PeftModel.from_pretrained(base_model, "parama123/phi3-mini-qlora-guanaco")QLoRA fine-tuned on Google Colab (T4 GPU) using free tools. Fits in 16GB VRAM.
microsoft/Phi-3-mini-4k-instruct (3.8B)from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
import torch
base = AutoModelForCausalLM.from_pretrained(
"microsoft/Phi-3-mini-4k-instruct",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
model = PeftModel.from_pretrained(base, "parama123/phi3-mini-qlora-guanaco")
tokenizer = AutoTokenizer.from_pretrained("parama123/phi3-mini-qlora-guanaco")
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
print(pipe("### Human: Explain QLoRA.\n### Assistant:")[0]["generated_text"])
## Training Notebook
[](https://colab.research.google.com/drive/1mLBrbGIoGg0HLqQYgADO-_Rr20bN32ry?usp=sharing)
Base model
microsoft/Phi-3-mini-4k-instruct