Instructions to use rudycaz/qwen35-27b-phish-qlora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use rudycaz/qwen35-27b-phish-qlora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-27B") model = PeftModel.from_pretrained(base_model, "rudycaz/qwen35-27b-phish-qlora") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,8 +1,69 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
-
|
| 4 |
-
- en
|
| 5 |
-
base_model:
|
| 6 |
-
- Qwen/Qwen3.5-27B
|
| 7 |
pipeline_tag: text-generation
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3.5-27B
|
|
|
|
|
|
|
|
|
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- peft
|
| 7 |
+
- lora
|
| 8 |
+
- qlora
|
| 9 |
+
- phishing
|
| 10 |
+
- email-security
|
| 11 |
+
- cybersecurity
|
| 12 |
+
- qwen
|
| 13 |
+
language:
|
| 14 |
+
- en
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# qwen35-27b-phish-qlora (QLoRA adapter)
|
| 18 |
+
|
| 19 |
+
This repository contains a **QLoRA/LoRA adapter** fine-tuned on a phishing-email dataset to help classify emails as **PHISHING** or **LEGIT**.
|
| 20 |
+
|
| 21 |
+
> This repo **does not** include the full base model weights. You must download the base model separately and load this adapter on top.
|
| 22 |
+
|
| 23 |
+
## Base model
|
| 24 |
+
- `Qwen/Qwen3.5-27B`
|
| 25 |
+
|
| 26 |
+
## Dataset
|
| 27 |
+
- Kaggle: `naserabdullahalam/phishing-email-dataset`
|
| 28 |
+
|
| 29 |
+
## What it does
|
| 30 |
+
Given an email body, the intended behavior is to output exactly one label:
|
| 31 |
+
- `PHISHING`
|
| 32 |
+
- `LEGIT`
|
| 33 |
+
|
| 34 |
+
## Quickstart (Transformers + PEFT)
|
| 35 |
+
|
| 36 |
+
### Install
|
| 37 |
+
```bash
|
| 38 |
+
pip install -U "transformers" "peft" "accelerate" "bitsandbytes" "torch"
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
import torch
|
| 42 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 43 |
+
from peft import PeftModel
|
| 44 |
+
|
| 45 |
+
BASE_ID = "Qwen/Qwen3.5-27B"
|
| 46 |
+
ADAPTER_ID = "rudycaz/qwen35-27b-phish-qlora" # this repo
|
| 47 |
+
|
| 48 |
+
tok = AutoTokenizer.from_pretrained(BASE_ID, trust_remote_code=True)
|
| 49 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 50 |
+
BASE_ID,
|
| 51 |
+
device_map="auto",
|
| 52 |
+
torch_dtype=torch.bfloat16,
|
| 53 |
+
trust_remote_code=True,
|
| 54 |
+
)
|
| 55 |
+
|
| 56 |
+
model = PeftModel.from_pretrained(model, ADAPTER_ID)
|
| 57 |
+
|
| 58 |
+
email_text = """Subject: Urgent! Verify your account
|
| 59 |
+
..."""
|
| 60 |
+
|
| 61 |
+
prompt = (
|
| 62 |
+
"You are a security assistant. Classify the following email as PHISHING or LEGIT.\n\n"
|
| 63 |
+
f"EMAIL:\n{email_text}\n\n"
|
| 64 |
+
"Answer with exactly one word: PHISHING or LEGIT."
|
| 65 |
+
)
|
| 66 |
+
|
| 67 |
+
inputs = tok(prompt, return_tensors="pt").to(model.device)
|
| 68 |
+
out = model.generate(**inputs, max_new_tokens=4)
|
| 69 |
+
print(tok.decode(out[0], skip_special_tokens=True))
|