Views
No views yet
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.
1import torch
2from peft import PeftModel
3from transformers import AutoModelForCausalLM, AutoTokenizer
4
5base = "unsloth/Qwen2.5-7B-Instruct-bnb-4bit"
6adapter = "jhenberthf/cybercop-ai-v2" # local path or HF repo
7
8tokenizer = AutoTokenizer.from_pretrained(base)
9if tokenizer.pad_token is None:
10 tokenizer.pad_token = tokenizer.eos_token
11model = AutoModelForCausalLM.from_pretrained(
12 base, device_map={"": "cuda:0"}, torch_dtype=torch.bfloat16
13)
14model = PeftModel.from_pretrained(model, adapter)
15model.eval()
16
17instruction = ("You are a cyber-investigation assistant. Given a complaint, "
18 "classify the likely cybercrime type, list immediate preservation "
19 "steps, and outline the next investigative actions.")
20inp = ("Victim reports being tricked into sending PHP 50,000 via GCash to a "
21 "suspect after a 'customer service' impostor promised a refund for a "
22 "purchase that was never delivered. The suspect account is now inactive.")
23
24# Alpaca-format text wrapped as a single chat user turn
25alpaca = f"### Instruction:\n{instruction}\n\n### Input:\n{inp}\n\n### Response:\n"
26prompt = tokenizer.apply_chat_template(
27 [{"role": "user", "content": alpaca}],
28 tokenize=False, add_generation_prompt=True,
29)
30
31inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
32out = model.generate(
33 **inputs, max_new_tokens=512, do_sample=False, temperature=1.0,
34 repetition_penalty=1.05,
35)
36text = tokenizer.decode(out[0], skip_special_tokens=True)
37# strip the prompt prefix, keep only the generated Response
38gen = text[len(tokenizer.decode(inputs["input_ids"][0], skip_special_tokens=False)):]
39resp = gen.split("### Response:")[-1].strip() if "### Response:" in gen else gen.strip()
40print(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.[UNIT] in all text fields (instruction, input, output, analysis):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)