Downloads · 30 days
17
25% of all-time downloads
Mohammadeeu20/besstie-sarcasm-gemma2b-lora-en-au
besstie-sarcasm-gemma2b-lora-en-au is a text classification model from Mohammadeeu20. Use it when you need a label for a piece of text. It is set up for peft. The card lists the license as gemma.
A 4-bit QLoRA adapter that turns google/gemma-2-2b into a binary sarcasm classifier for Australian English text (Google reviews and Reddit posts). It is one of three variety-specific adapters (British, Australian, Ind…
Downloads · 30 days
17
25% of all-time downloads
All-time downloads
69
Public
Repo size
25.6 MB
Likes
0
Public
Click a slice to open those files.
.safetensors25.6 MB · 100%
From the Hugging Face model README
A 4-bit QLoRA adapter that turns google/gemma-2-2b into a binary sarcasm classifier for Australian English text (Google reviews and Reddit posts).
It is one of three variety-specific adapters (British, Australian, Indian English) that share a single base model and can be swapped at request time.
python src/app.py from the GitHub repoTest-set results for this adapter (seed 123, the uploaded checkpoint), evaluated on each English variety:
| Test variety | Macro-F1 | Sarcastic-class F1 | Accuracy |
|---|---|---|---|
| en-UK (British English) | 0.628 | 0.392 | 0.779 |
| en-AU (Australian English) (in-variety) | 0.793 | 0.709 | 0.828 |
| en-IN (Indian English) | 0.578 | 0.293 | 0.770 |
Across two seeds, the in-variety Macro-F1 is 0.774 ± 0.026, compared with 0.752 for full RoBERTa-base fine-tuning on the same split.
The strongest adapter: Australian English has the most sarcastic training examples (337), which LoRA benefits from.
Efficiency: about 0.4% of parameters trained (6.4M of 1.6B), and the adapter is about 25 MB on disk, against roughly 500 MB for a full RoBERTa checkpoint. Measured single-example GPU latency was about 39 ms with the 4-bit base.
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True, bnb_4bit_compute_dtype=torch.float16)
tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-2b")
base = AutoModelForSequenceClassification.from_pretrained(
"google/gemma-2-2b", num_labels=2, quantization_config=bnb,
torch_dtype=torch.float16, device_map="auto")
base.config.pad_token_id = tokenizer.pad_token_id
model = PeftModel.from_pretrained(base, "Mohammadeeu20/besstie-sarcasm-gemma2b-lora-en-au").eval()
inputs = tokenizer("Oh brilliant, another delayed train.", return_tensors="pt").to(model.device)
with torch.inference_mode():
p_sarcastic = model(**inputs).logits.float().softmax(-1)[0, 1].item()
print(f"P(sarcastic) = {p_sarcastic:.3f}")
Label 1 = sarcastic, label 0 = not sarcastic. Gemma is a gated model, so accept its licence on Hugging Face and log in before loading.
Built as part of a team project for the COMM061 Natural Language Processing module at the University of Surrey (2026). Author of this release: Mohammad Abdalaziz.