Downloads · 30 days
12
26% of all-time downloads
strectelite/mnli-llama3.2-1b-qlora-10k
mnli-llama3.2-1b-qlora-10k is a text classification model from strectelite. Use it when you need a label for a piece of text. It is set up for peft. The card lists the license as apache-2.0.
This is a QLoRA fine-tuned version of meta-llama/Llama-3.2-1B-Instruct on the MNLI (Multi-Genre Natural Language Inference) dataset from GLUE.
Downloads · 30 days
12
26% of all-time downloads
All-time downloads
46
Public
Repo size
39.8 MB
Likes
0
Public
Click a slice to open those files.
.safetensors22.6 MB · 57%
From the Hugging Face model README
This is a QLoRA fine-tuned version of meta-llama/Llama-3.2-1B-Instruct on the MNLI (Multi-Genre Natural Language Inference) dataset from GLUE.
⚠️ Note: This repo contains only the LoRA adapter weights. You need access to the base model from Meta to use it.
from transformers import AutoTokenizer, AutoModelForSequenceClassification, BitsAndBytesConfig
from peft import PeftModel
import torch
BASE = "meta-llama/Llama-3.2-1B-Instruct"
ADAPTER = "streetelite/mnli-llama3.2-1b-qlora-10k"
bnb = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
bnb_4bit_use_double_quant=True
)
tokenizer = AutoTokenizer.from_pretrained(ADAPTER)
model = AutoModelForSequenceClassification.from_pretrained(
BASE,
num_labels=3,
quantization_config=bnb,
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(model, ADAPTER).eval()
inputs = tokenizer(
"A man is playing guitar.",
"A person is making music.",
return_tensors="pt",
truncation=True
)
with torch.inference_mode():
logits = model(**{k: v.to(model.device) for k, v in inputs.items()}).logits
probs = logits.softmax(-1)
print(probs)
| Set | Accuracy | F1 (macro) | F1 (weighted) | MCC | Kappa | MAE |
|---|---|---|---|---|---|---|
| Matched | 82.37% | 0.8210 | 0.8224 | 0.7358 | 0.7349 | 0.2068 |
| Mismatched | 83.71% | 0.8348 | 0.8360 | 0.7558 | 0.7550 | 0.1894 |
| Accuracy | F1 (macro) | F1 (weighted) | MCC | Kappa | MAE |
|---|---|---|---|---|---|
| 83.10% | 0.8280 | 0.8288 | 0.7496 | 0.7461 | 0.2010 |
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj