Text Classification
PEFT
Safetensors
Transformers
English
lora
sft
trl
unsloth
phishing-detection
email-security
Instructions to use ellachang/phishing-detector-27b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ellachang/phishing-detector-27b-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3.6-27B") model = PeftModel.from_pretrained(base_model, "ellachang/phishing-detector-27b-lora") - Transformers
How to use ellachang/phishing-detector-27b-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ellachang/phishing-detector-27b-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ellachang/phishing-detector-27b-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use ellachang/phishing-detector-27b-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
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 ellachang/phishing-detector-27b-lora to start chatting
Install Unsloth Studio (Windows)
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 ellachang/phishing-detector-27b-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ellachang/phishing-detector-27b-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="ellachang/phishing-detector-27b-lora", max_seq_length=2048, )
phishing-detector-27b — QLoRA LoRA Adapter
QLoRA fine-tuned LoRA adapter for Qwen3.6-27B on phishing email binary classification.
Base model: unsloth/Qwen3.6-27B
Performance (400-sample test set)
| Metric | Value |
|---|---|
| Accuracy | 99.0% |
| Precision | 0.980 |
| Recall | 1.000 |
| F1-Score | 0.990 |
Per-category accuracy:
| Category | Accuracy |
|---|---|
| Human-Phishing | 100% |
| Human-Legitimate | 96% |
| LLM-Phishing | 100% |
| LLM-Legitimate | 100% |
Training Data
Human-LLM Generated Phishing-Legitimate Emails (Kaggle)
4,000 emails across 4 classes: Human-Phishing, Human-Legitimate, LLM-Phishing, LLM-Legitimate (1,000 each).
Split: 80% train / 10% val / 10% test (stratified).
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = AutoModelForCausalLM.from_pretrained(
"unsloth/Qwen3.6-27B",
load_in_4bit=True,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, "ellachang/phishing-detector-27b-lora")
tokenizer = AutoTokenizer.from_pretrained("ellachang/phishing-detector-27b-lora")
prompt = """Analyze the following email and determine if it is a phishing email or a legitimate email. Provide your classification.
### Input:
{email_text}
### Response:"""
inputs = tokenizer(prompt.format(email_text="<your email here>"), return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=20, temperature=0)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training Details
- Method: QLoRA (4-bit quantization + LoRA)
- LoRA rank: r=16, alpha=16
- Target modules: q_proj, k_proj, v_proj, o_proj
- Epochs: 3 (train_loss: 1.270)
- Hardware: NVIDIA RTX 4090 (24GB VRAM)
- Framework: Unsloth + TRL SFTTrainer
Project
Part of a term project on LLM-based phishing detection with RAG and Chain-of-Thought analysis.
Source code: [GitHub repo link]
- Downloads last month
- 3