ykarout's picture
Update README.md
9e6e3aa verified
metadata
license: apache-2.0
base_model: ykarout/RPT-DeepSeek-R1-0528-Qwen3-8B
tags:
  - cybersecurity
  - fine-tuned
  - deepseek
  - qwen3
  - lora
  - cyber
  - nist
  - csf
  - pentest
language:
  - en
  - ar
  - es
  - ru
  - it
  - de
pipeline_tag: text-generation
datasets:
  - Trendyol/Trendyol-Cybersecurity-Instruction-Tuning-Dataset
library_name: transformers

CyberSec-Qwen3-DeepSeekv1

This is a cybersecurity-specialized fine-tuned model based on DeepSeek-R1-Qwen3-8B.

Model Details

  • Base Model: ykarout/RPT-DeepSeek-R1-0528-Qwen3-8B
  • Fine-tuning Method: LoRA (Low-Rank Adaptation)
  • Dataset: Trendyol Cybersecurity Instruction Tuning Dataset
  • Specialization: Cybersecurity expertise and guidance

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_name = "ykarout/CyberSec-Qwen3-DeepSeekv1"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True
)

# Example usage
messages = [
    {"role": "system", "content": "You are a cybersecurity expert."},
    {"role": "user", "content": "What is a DDoS attack and how can it be mitigated?"}
]

input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=512,
        temperature=0.7,
        do_sample=True,
        pad_token_id=tokenizer.eos_token_id
    )

response = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True)
print(response)

Training Details

  • Framework: TRL (Transformers Reinforcement Learning)
  • Training Method: Supervised Fine-Tuning (SFT) with LoRA
  • Assistant-only Loss: Custom data collator for training only on assistant responses
  • Hardware: NVIDIA H100
  • Precision: bfloat16

Ethical Use

This model is designed for educational and defensive cybersecurity purposes only. Please use responsibly and in accordance with applicable laws and ethical guidelines.

License

Apache 2.0