Downloads · 30 days
11
18% of all-time downloads
jhenberthf/cybercop-ai-v2
cybercop-ai-v2 is a machine learning model from jhenberthf. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as other.
A LoRA adapter that turns Qwen2.5-7B-Instruct (4-bit) into a focused cyber-investigation assistant — trained to produce structured, procedure-oriented responses for cybercrime / online-scam / digital-forensics triage…
Downloads · 30 days
11
18% of all-time downloads
All-time downloads
61
Public
Repo size
173 MB
Likes
0
Public
Click a slice to open those files.
.safetensors162 MB · 91%
From the Hugging Face model README
A LoRA adapter that turns Qwen2.5-7B-Instruct (4-bit) into a focused cyber-investigation assistant — trained to produce structured, procedure-oriented responses for cybercrime / online-scam / digital-forensics triage and reporting, in English and Taglish. V2 improves on the original jhenberthf/cybercop-ai adapter with a larger synthetic-augmented dataset, stricter unit-label scrubbing, and longer training.
Intended use: Exclusive internal use as an investigative-aid assistant. The adapter is a decision-support tool, not an authority — all outputs must be reviewed by a qualified human investigator before any action.
| Field | Value |
|---|---|
| Base model | unsloth/Qwen2.5-7B-Instruct-bnb-4bit |
| Adapter type | LoRA (PEFT) |
| Adapter ID | jhenberthf/cybercop-ai-v2 |
| Predecessor | jhenberthf/cybercop-ai (V1, 99-row curated only) |
LoRA rank r | 16 |
| LoRA alpha | 32 |
| LoRA dropout | 0.05 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Precision | 4-bit base (bitsandbytes NF4) + bf16 training |
| Training data | jhenberthf/cyber-investigator (Alpaca format, 2011 rows: 311 curated + 1700 synthetic) |
| Epochs | 1 (502 steps, ~2 epochs of data) |
| Max sequence length | 256 |
| Trainable params | ~40.4M (0.53% of base) |
| Final train loss | 0.2654 |
| Hardware | NVIDIA RTX 3050 6GB (CUDA 12.6), single local GPU |
jhenberthf/cyber-investigator.[UNIT] before training — both inline on the dataset rows and as a defense-in-depth pass on generated outputs.Prompt format (important): the adapter was trained on Alpaca-format (
### Instruction / ### Input / ### Response) text. Wrap that text inside a single Qwen chat-template user turn — do not feed raw Alpaca text, or the base Instruct model will echo the instruction and drift off-topic.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "unsloth/Qwen2.5-7B-Instruct-bnb-4bit"
adapter = "jhenberthf/cybercop-ai-v2" # local path or HF repo
tokenizer = AutoTokenizer.from_pretrained(base)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained(
base, device_map={"": "cuda:0"}, torch_dtype=torch.bfloat16
)
model = PeftModel.from_pretrained(model, adapter)
model.eval()
instruction = ("You are a cyber-investigation assistant. Given a complaint, "
"classify the likely cybercrime type, list immediate preservation "
"steps, and outline the next investigative actions.")
inp = ("Victim reports being tricked into sending PHP 50,000 via GCash to a "
"suspect after a 'customer service' impostor promised a refund for a "
"purchase that was never delivered. The suspect account is now inactive.")
# Alpaca-format text wrapped as a single chat user turn
alpaca = f"### Instruction:\n{instruction}\n\n### Input:\n{inp}\n\n### Response:\n"
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": alpaca}],
tokenize=False, add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(
**inputs, max_new_tokens=512, do_sample=False, temperature=1.0,
repetition_penalty=1.05,
)
text = tokenizer.decode(out[0], skip_special_tokens=True)
# strip the prompt prefix, keep only the generated Response
gen = text[len(tokenizer.decode(inputs["input_ids"][0], skip_special_tokens=False)):]
resp = gen.split("### Response:")[-1].strip() if "### Response:" in gen else gen.strip()
print(resp)
adamw_torch optimizer, gradient checkpointing (non-reentrant), and bf16 precision.checkpoint-250 (step 250, loss 0.3552, epoch 0.497) and completed 502 steps on 2026-08-25. Total wall-clock from resume ≈ 2h15m.Before training, a defensive regex pass replaces the following categories with [UNIT] in all text fields (instruction, input, output, analysis):
This is applied inline on every dataset row before training, and again on generated outputs at inference time as defense in depth — to avoid the adapter learning or leaking operational unit identifiers.
Adapter weights released under a restrictive/internal-use understanding. Base model terms from unsloth/Qwen2.5-7B-Instruct-bnb-4bit and Qwen2.5 apply to the underlying weights.
jhenberthf/cybercop-aijhenberthf/cyber-investigatorcybercop_irs (209 chunks, paraphrase-multilingual-MiniLM-L12-v2)