Views
No views yet
unsloth/Qwen3-0.6Bzobayer0x01/cybersecurity-qaYou are a helpful assistant specialized in cybersecurity Q&A.| Field | Value |
|---|---|
| Method | LORA |
| Precision | fp16 |
| Quantization | none |
| Mode | steps |
| Num Epochs | 1 |
| Max Steps | 4500 |
| Eval Steps | 1200 |
| Save Steps | 2400 |
| LR | 0.0001 |
| Max Length | 768 |
| per_device_batch_size | 1 |
| grad_accum | 8 |
| Metric | Score |
|---|---|
| BLEU-4 | 1.57 |
| ROUGE-L | 13.29 |
| F1 (token-level) | 25.86 |
| chrF++ | 20.39 |
| BERTScore F1 | 82.64 |
| Perplexity | 16.27 |
Notes: We normalize whitespace/punctuations, compute token-level P/R/F1, and useevaluate'ssacrebleu/rouge/chrf/bertscore.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3tok = AutoTokenizer.from_pretrained("nhonhoccode/qwen3-0-6b-cybersecqa-lora-20251124-2107")
4base = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3-0.6B")
5mdl = PeftModel.from_pretrained(base, "nhonhoccode/qwen3-0-6b-cybersecqa-lora-20251124-2107") # Loads LoRA adapter
6prompt = tok.apply_chat_template(
7 [{"role":"system","content":"You are a helpful assistant specialized in cybersecurity Q&A."},
8 {"role":"user","content":"Explain SQL injection in one paragraph."}],
9 tokenize=False, add_generation_prompt=True
10)
11ids = tok(prompt, return_tensors="pt").input_ids
12out = mdl.generate(ids, max_new_tokens=128, do_sample=False)
13print(tok.decode(out[0][ids.shape[-1]:], skip_special_tokens=True))transformers>=4.43,<5, accelerate>=0.33,<0.34, peft>=0.11,<0.13, datasets>=2.18,<3, evaluate>=0.4,<0.5,
rouge-score, sacrebleu, huggingface_hub>=0.23,<0.26, bitsandbytes