Vyber07/cyber-security
Viewer • Updated • 1 • 122k • 2.37k
How to use hezone/Qwen3.8-27B-Uncensored-CyberSec-RE with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="hezone/Qwen3.8-27B-Uncensored-CyberSec-RE")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
pipe(text=messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("hezone/Qwen3.8-27B-Uncensored-CyberSec-RE")
model = AutoModelForMultimodalLM.from_pretrained("hezone/Qwen3.8-27B-Uncensored-CyberSec-RE", device_map="auto")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
inputs = processor.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=256)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use hezone/Qwen3.8-27B-Uncensored-CyberSec-RE with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "hezone/Qwen3.8-27B-Uncensored-CyberSec-RE"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "hezone/Qwen3.8-27B-Uncensored-CyberSec-RE",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'docker model run hf.co/hezone/Qwen3.8-27B-Uncensored-CyberSec-RE
How to use hezone/Qwen3.8-27B-Uncensored-CyberSec-RE with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "hezone/Qwen3.8-27B-Uncensored-CyberSec-RE" \
--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": "hezone/Qwen3.8-27B-Uncensored-CyberSec-RE",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'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 "hezone/Qwen3.8-27B-Uncensored-CyberSec-RE" \
--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": "hezone/Qwen3.8-27B-Uncensored-CyberSec-RE",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'How to use hezone/Qwen3.8-27B-Uncensored-CyberSec-RE with Docker Model Runner:
docker model run hf.co/hezone/Qwen3.8-27B-Uncensored-CyberSec-RE
Cybersecurity domain-adapted Merged Full BF16 Checkpoint fine-tuned from orcarouter/Qwen3.8-27B-Uncensored (Qwen3_5ForConditionalGeneration, hybrid 48 Gated DeltaNet linear_attn + 16 full self_attn).
Curated from Vyber07/cyber-security using strict deduplication, double-escape normalization, refusal filtering, prompt-prefix capping, length filtering, and zero-leakage stratified splitting:
226767491214 (verified 0 prompt-hash overlap with train/val)220426-CyberSec-Dataset_escaped.jsonl (unescaped, domain-stratified), vulnerability-intelligence/cybersec_master.jsonl (streamed bucketed reservoir: multi-turn, non-NVD advisories/MITRE/Kali/Code4rena/OSV, informative NVD triage), real_cybersecurity_master_expansion.jsonl, and code_train.jsonl (<think> coding retention anchors).r=32, alpha=64, dropout=0.05nn.Linear layers only (model.language_model.layers.* — 496 modules across 48 linear_attn, 16 self_attn, 64 mlp; explicitly excluding visual, mtp, conv1d, lm_head, embed_tokens)8e-05 cosine with 0.05 warmup32 / 2048 (length-grouped dynamic padding, zero cross-document packing to preserve Gated DeltaNet recurrent state isolation)enable_thinking=False masks <think>\n\n</think>\n\n; enable_thinking=True anchor rows supervise <think>...</think> + final answer)0.86748 / 2.3809 (wall clock 19621.31s, peak VRAM 68.55 GB)| Benchmark / Metric | Base (Qwen3.8-27B-Uncensored) |
Fine-Tuned | Delta | Rel. Change |
|---|---|---|---|---|
| Held-Out Loss (overall) ↓ | 1.2169 | 0.8761 | -0.3408 | -28.00% |
| Held-Out Perplexity (overall) ↓ | 3.377 | 2.402 | -0.9752 | -28.88% |
| CyberMetric-500 Acc (%) ↑ | 94.80% | 94.80% | +0.00 pp | +0.00% |
| CTI-Bench MCQ Acc (%) ↑ | 75.60% | 74.20% | -1.40 pp | -1.85% |
| SecEval Acc (%) ↑ | 94.40% | 95.60% | +1.20 pp | +1.27% |
| SecBench EN Acc (%) ↑ | 85.00% | 83.00% | -2.00 pp | -2.35% |
| SecBench ZH Acc (%) ↑ | 93.00% | 92.33% | -0.67 pp | -0.72% |
| CTI-Bench RCM Exact CWE (%) ↑ | 72.00% | 72.00% | +0.00 pp | +0.00% |
| CTI-Bench VSP CVSS MAE ↓ | 0.5000 | 1.6444 | +1.1444 | +228.88% |
| CTI-Bench VSP Severity Tier Acc (%) ↑ | 0.67% | 42.67% | +42.00 pp | +6268.66% |
| Defensive Non-Refusal All (%) ↑ | 100.00% | 100.00% | +0.00 pp | +0.00% |
| Mode Integrity (%) ↑ | 40.00% | 100.00% | +60.00 pp | +150.00% |
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer
model_id = "hezone/Qwen3.8-27B-Uncensored-CyberSec-RE"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map='auto')