teknium/OpenHermes-2.5
Viewer โข Updated โข 1M โข 17.3k โข 870
How to use m4xx101/llama-3.2-3b-lora with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit")
model = PeftModel.from_pretrained(base_model, "m4xx101/llama-3.2-3b-lora")How to use m4xx101/llama-3.2-3b-lora with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for m4xx101/llama-3.2-3b-lora to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for m4xx101/llama-3.2-3b-lora to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for m4xx101/llama-3.2-3b-lora to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="m4xx101/llama-3.2-3b-lora",
max_seq_length=2048,
)A QLoRA adapter fine-tuning Meta's Llama 3.2 3B Instruct on OpenHermes 2.5 โ one of the largest and most diverse instruction-tuning datasets available. This adapter punches well above its 97 MB weight class: load it alongside the 4-bit base model and you get a compact, fast, and surprisingly capable chat model that runs comfortably on a single consumer GPU or even CPU with quantization.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "m4xx101/llama-3.2-3b-lora"
base_model = "unsloth/Llama-3.2-3B-Instruct-bnb-4bit"
model = AutoModelForCausalLM.from_pretrained(
base_model,
load_in_4bit=True,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
messages = [
{"role": "system", "content": "You are a helpful AI assistant."},
{"role": "user", "content": "Explain quantum computing in one paragraph."},
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to("cuda")
outputs = model.generate(inputs, max_new_tokens=256, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
merged = model.merge_and_unload()
merged.save_pretrained("./llama-3.2-3b-openhermes-merged")
tokenizer.save_pretrained("./llama-3.2-3b-openhermes-merged")
| Parameter | Value |
|---|---|
| Base model | unsloth/Llama-3.2-3B-Instruct (4-bit BnB) |
| Dataset | teknium/OpenHermes-2.5 |
| Method | QLoRA (4-bit NF4 + LoRA) |
| LoRA rank (r) | 16 |
| LoRA alpha | 16 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Training steps | 30 |
| Final loss | 0.72 |
| Framework | Unsloth + PEFT 0.18.1 |
Apache 2.0 โ same as the base Llama 3.2 model. Use it, merge it, stack it, ship it.
Built with Unsloth โ the fastest way to fine-tune open LLMs on consumer hardware.
Base model
meta-llama/Llama-3.2-3B-Instruct