A fine-tuned version of
Qwen/Qwen2.5-3B-Instruct trained on cybersecurity instruction-response data using LoRA (Low-Rank Adaptation).
1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name = "Aaqisher667/qwen3b-cyber-finetuned",
5 max_seq_length = 512,
6 dtype = None,
7 load_in_4bit = True,
8)
9FastLanguageModel.for_inference(model)
1messages = [
2 {"role": "system", "content": "You are a cybersecurity expert assistant."},
3 {"role": "user", "content": "What is a SQL injection attack?"},
4]
5chat = tokenizer.apply_chat_template(
6 messages,
7 tokenize=False,
8 add_generation_prompt=True
9)
10inputs = tokenizer(chat, return_tensors="pt").to(model.device)
11import torch
12with torch.no_grad():
13 out = model.generate(
14 **inputs,
15 max_new_tokens = 256,
16 temperature = 0.7,
17 do_sample = True,
18 )
19response = tokenizer.decode(
20 out[0][inputs["input_ids"].shape[1]:],
21 skip_special_tokens=True
22)
23print(response)
Runs comfortably on a free Google Colab T4 GPU.