Downloads · 30 days
17
43% of all-time downloads
muditbaid/llama31-8b-hatexplain-lora
llama31-8b-hatexplain-lora is a text generation model from muditbaid. Use it when you need the model to write or continue text. It is set up for peft.
- Base model: meta-llama/Meta-Llama-3.1-8B-Instruct - Adapter: LoRA (rank=8, alpha=16, dropout=0.05, target=all) - Trainable params: ~0.26% (≈20.97M / 8.05B) - Task: hate speech detection (3 classes: hatespeech, offen…
Downloads · 30 days
17
43% of all-time downloads
All-time downloads
40
Public
Repo size
84 MB
Likes
0
Public
Click a slice to open those files.
.safetensors83.9 MB · 100%
From the Hugging Face model README
meta-llama/Meta-Llama-3.1-8B-Instructhatespeech, offensive, normal)from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
base = "meta-llama/Meta-Llama-3.1-8B-Instruct"
adapter = "<your-username>/<your-adapter-repo>" # or local path to this checkpoint
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, adapter)
# Build a llama3-style prompt and generate the label ("hatespeech"/"offensive"/"normal")
llama3, cutoff length: 2048saves/llama31-8b/hatexplain/loradatasets), majority-vote label from annotatorsinstruction + input → label as assistant responseOverall:
Per-class report:
precision recall f1-score support
hatespeech 0.7252 0.8634 0.7883 593
offensive 0.6152 0.4726 0.5346 548
normal 0.7698 0.7836 0.7766 781
accuracy 0.7196 1922
macro avg 0.7034 0.7065 0.6998 1922
weighted avg 0.7120 0.7196 0.7112 1922
Notes:
pad_token = eos_token for batched evaluation.