AlicanKiraz0/Cybersecurity-Dataset-Fenrir-v2.1
Viewer • Updated • 99.9k • 9.33k • 90
How to use sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged")
model = AutoModelForCausalLM.from_pretrained("sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged
How to use sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged with Docker Model Runner:
docker model run hf.co/sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged
This is the merged version of sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B, where the LoRA adapter has been merged into the base model for easier deployment.
Fine-tuned deepseek-ai/DeepSeek-R1-0528-Qwen3-8B specialized for cybersecurity tasks. This merged model can be loaded directly without needing PEFT.
| Parameter | Value |
|---|---|
| Base Model | deepseek-ai/DeepSeek-R1-0528-Qwen3-8B |
| Training Samples | ~50,000 |
| Epochs | 2 |
| LoRA Rank | 16 |
| LoRA Alpha | 32 |
| Learning Rate | 2e-4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
"sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged",
trust_remote_code=True
)
prompt = "Explain how to detect SQL injection attacks."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
import requests
API_URL = "https://api-inference.huggingface.co/models/sainikhiljuluri/DeepSeek-R1-Cybersecurity-8B-Merged"
headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}
response = requests.post(API_URL, headers=headers, json={
"inputs": "What are the indicators of a ransomware attack?",
"parameters": {"max_new_tokens": 256, "temperature": 0.7}
})
print(response.json())
Base model
deepseek-ai/DeepSeek-R1-0528-Qwen3-8B