Downloads · 30 days
13
16% of all-time downloads
betulbayram/secllm-tr-mistral-7b-qlora
secllm-tr-mistral-7b-qlora is a text generation model from betulbayram. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Mistral 7B Instruct v0.3 üzerine QLoRA ile fine-tune edilmiş, siber güvenlik alanına özelleşmiş Türkçe dil modeli.
Downloads · 30 days
13
16% of all-time downloads
All-time downloads
81
Public
Repo size
672 MB
Likes
0
Public
Click a slice to open those files.
.safetensors671 MB · 99%
From the Hugging Face model README
Mistral 7B Instruct v0.3 üzerine QLoRA ile fine-tune edilmiş, siber güvenlik alanına özelleşmiş Türkçe dil modeli.
| Base model | mistralai/Mistral-7B-Instruct-v0.3 |
| Yöntem | QLoRA (4-bit NF4, LoRA r=64, α=128) |
| Donanım | NVIDIA RTX 3090 (24GB) |
| Dataset | 1.339 Türkçe siber güvenlik instruction-response çifti |
| Epoch | 3 (efektif batch 16, lr 2e-4 cosine) |
| Eğitim süresi | ~2.7 saat |
| Final train loss | ~0.50 |
Dataset kaynakları: NVD/CVE, MITRE ATT&CK ve Ollama Cloud (gpt-oss:120b) ile
üretilen sentetik Türkçe analizler. Detay: DATASET_CARD.
Test setinde (40 örnek) base vs fine-tuned:
| Metrik | Base Mistral 7B | SecLLM-TR | Δ |
|---|---|---|---|
| ROUGE-L | 0.097 | 0.107 | +0.01 |
| BLEU | 0.00 | 0.21 | +0.21 |
| Ort. yanıt uzunluğu | 1040 | 1134 | +93 |
En belirgin kazanım BLEU'da (0.00 → 0.21): model, hedef Türkçe uzman analiz formatını öğrenmiştir. Otomatik metrikler açık uçlu üretimde sınırlıdır; format tutarlılığı ve domain dili gibi niteliksel iyileşmeler demoda daha belirgindir.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
BASE = "mistralai/Mistral-7B-Instruct-v0.3"
ADAPTER = "<HF_KULLANICI>/secllm-tr-mistral-7b-qlora"
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16)
tok = AutoTokenizer.from_pretrained(BASE)
model = AutoModelForCausalLM.from_pretrained(BASE, quantization_config=bnb, device_map="auto")
model = PeftModel.from_pretrained(model, ADAPTER)
SYSTEM = ("Sen SecLLM-TR, siber güvenlik alanında uzmanlaşmış Türkçe bir asistansın. "
"Teknik olarak doğru ve profesyonel yanıtlar verirsin.")
soru = "SQL injection saldırısından nasıl korunurum?"
msgs = [{"role": "user", "content": f"{SYSTEM}\n\n{soru}"}]
inputs = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=512, do_sample=True, temperature=0.7)
print(tok.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
gpt-oss:120b çıktısıdır; nadiren hata/yanlılık içerebilir.@misc{secllm-tr,
title = {SecLLM-TR: Fine-Tuned Turkish Cybersecurity Language Model},
author = {Bayram, Betül},
year = {2026},
url = {https://huggingface.co/<HF_KULLANICI>/secllm-tr-mistral-7b-qlora}
}
Lisans: Apache 2.0