AlicanKiraz0/Cybersecurity-Dataset-v1
Viewer • Updated • 2.41k • 174 • 15
How to use Aaqisher667/tinyllama-cyber-finetuned with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("unsloth/tinyllama-chat-bnb-4bit")
model = PeftModel.from_pretrained(base_model, "Aaqisher667/tinyllama-cyber-finetuned")How to use Aaqisher667/tinyllama-cyber-finetuned with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Aaqisher667/tinyllama-cyber-finetuned to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Aaqisher667/tinyllama-cyber-finetuned to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Aaqisher667/tinyllama-cyber-finetuned to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="Aaqisher667/tinyllama-cyber-finetuned",
max_seq_length=2048,
)A fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0 trained on cybersecurity instruction-response data using LoRA (Low-Rank Adaptation).
| Property | Value |
|---|---|
| Base model | TinyLlama/TinyLlama-1.1B-Chat-v1.0 |
| Model type | Causal Language Model |
| Parameters | 1.1B |
| Fine-tuning method | LoRA (PEFT) |
| Training framework | Unsloth + TRL |
| Language | English |
| License | Apache-2.0 |
| Domain | Cybersecurity |
| Setting | Value |
|---|---|
| Dataset | AlicanKiraz0/Cybersecurity-Dataset-v1 |
| Training examples | ~2,500 |
| Epochs | 3 |
| LoRA rank (r) | 16 |
| LoRA alpha | 16 |
| Learning rate | 2e-4 |
| Batch size | 2 |
| Gradient accumulation | 4 |
| Max sequence length | 512 |
| Quantization | 4-bit (NF4) |
| Hardware | Tesla T4 GPU |
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "Aaqisher667/tinyllama-cyber-finetuned",
max_seq_length = 512,
dtype = None,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
messages = [
{"role": "system", "content": "You are a cybersecurity expert assistant."},
{"role": "user", "content": "What is a SQL injection attack?"},
]
chat = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(chat, return_tensors="pt").to(model.device)
import torch
with torch.no_grad():
out = model.generate(
**inputs,
max_new_tokens = 256,
temperature = 0.7,
do_sample = True,
)
response = tokenizer.decode(
out[0][inputs["input_ids"].shape[1]:],
skip_special_tokens=True
)
print(response)
This model is intended for:
| Setting | Minimum |
|---|---|
| VRAM (4-bit) | ~2 GB |
| VRAM (full) | ~5 GB |
| RAM | 8 GB |
Runs comfortably on a free Google Colab T4 GPU.
This model was fine-tuned on AlicanKiraz0/Cybersecurity-Dataset-v1.
| Property | Detail |
|---|---|
| Dataset | AlicanKiraz0/Cybersecurity-Dataset-v1 |
| Size | ~2,500 instruction-response pairs |
| Domain | Cybersecurity — defensive concepts, vulnerability analysis, security best practices |
| Format | System / User / Assistant instruction tuning format |
| Source | Publicly available on HuggingFace |
Base model
TinyLlama/TinyLlama-1.1B-Chat-v1.0