Downloads · 30 days
80
17% of all-time downloads
vete-speis/gemma-4-E2B-it-phishing
gemma-4-E2B-it-phishing is a text generation model from vete-speis. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as gemma.
LoRA fine-tune of google/gemma-4-E2B-it that classifies emails as phishing or legit with a single-word answer.
Downloads · 30 days
80
17% of all-time downloads
All-time downloads
459
Public
Repo size
8.4 GB
Likes
1
Public
Click a slice to open those files.
.gguf8.4 GB · 99%
From the Hugging Face model README
LoRA fine-tune of google/gemma-4-E2B-it that classifies emails as phishing or legit with a single-word answer.
This repo contains:
Q4_K_M (3.4 GB) and Q8_0 (5 GB)Evaluated on 1,000 held-out emails (balanced, English):
| Model | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|
| gemma-4-E2B-it zero-shot | 85.7% | 90.3% | 78.9% | 0.842 |
| + this LoRA | 95.6% | 98.4% | 98.0% | 0.982 |
Notes: 26/1000 outputs were off-format and counted as errors (accuracy on parsable outputs: 98.2%). Zero-shot baseline measured on a 300-email subset.
The model expects this exact system prompt (it was trained with it):
You are an email security classifier. Classify the email as 'phishing' or 'legit'. Respond with one word only.
Download phishing-gemma4-e2b-Q4_K_M.gguf, set the system prompt above, temperature 0, paste an email as the user message. Requires a llama.cpp build recent enough for the gemma4 architecture.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
BASE = "google/gemma-4-E2B-it"
tok = AutoTokenizer.from_pretrained(BASE)
model = AutoModelForCausalLM.from_pretrained(BASE, dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, "vete-speis/gemma-4-E2B-it-phishing")
msgs = [
{"role": "system", "content": "You are an email security classifier. Classify the email as 'phishing' or 'legit'. Respond with one word only."},
{"role": "user", "content": "Your account has been suspended. Verify now: http://secure-login.example.xyz"},
]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=5, do_sample=False)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True)) # -> phishing
SFTTrainer + PEFT LoRA — r=16, alpha=32, dropout 0.05, targets: the inner nn.Linear of q/k/v/o projections (Gemma 4 wraps them in Gemma4ClippableLinear, which PEFT cannot wrap directly)phishing. If you need a strict spam ≠ phishing distinction, you need 3-class data.phishing/legit and treat anything else as abstention.Gemma derivatives are governed by the Gemma Terms of Use. The adapter and GGUF files here are derivatives of google/gemma-4-E2B-it.