Downloads · 30 days
38
31% of all-time downloads
raih443/sast-llm-qwen25_coder-sva
sast-llm-qwen25_coder-sva is a text generation model from raih443. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Static Analysis Security Tool berbasis LLM. Fine-tuned dari Qwen/Qwen2.5-Coder-7B-Instruct menggunakan QLoRA untuk mendeteksi kerentanan keamanan pada kode C/C++.
Downloads · 30 days
38
31% of all-time downloads
All-time downloads
122
Public
Parameters
7.6B
19.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors15.2 GB · 76%
From the Hugging Face model README
Static Analysis Security Tool berbasis LLM.
Fine-tuned dari Qwen/Qwen2.5-Coder-7B-Instruct menggunakan QLoRA
untuk mendeteksi kerentanan keamanan pada kode C/C++.
| Parameter | Value |
|---|---|
| Base Model | Qwen/Qwen2.5-Coder-7B-Instruct |
| Training Type | SVA |
| Identifier | PERCOBAAN_2 |
| LoRA Rank | 8 |
| LoRA Alpha | 32 |
| Max Seq Length | 512 |
| Epochs | 3 |
| Effective Batch | 64 |
| Learning Rate | 0.0002 |
| Completed | 2026-05-16T19:22:11.717011 |
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "raih443/sast-llm-qwen25_coder-sva"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype = torch.float16,
device_map = "auto",
)
# Contoh analisis vulnerability
code = (
"int main() {\n"
" char buffer[10];\n"
" gets(buffer); // buffer overflow!\n"
" return 0;\n"
"}")
messages = [
{"role": "system",
"content": "You are a security vulnerability detector. "
"Respond with 1 if vulnerable or 0 if safe."},
{"role": "user",
"content": f"Analyze this C code:\n```c\n{code}\n```"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False,
add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens = 50,
temperature = 0.1,
do_sample = False,
)
response = tokenizer.decode(
outputs[0][inputs["input_ids"].shape[1]:],
skip_special_tokens=True
)
print(response) # "1" = vulnerable, "0" = safe
1 = vulnerable, 0 = safe)SVAModel tersedia dalam format GGUF (f16) di folder gguf/ untuk dipakai dengan llama.cpp / Ollama.
1/0) tanpa penjelasan detail@misc{sast-llm-percobaan_2,
title = {SAST-LLM: Fine-tuned QWEN25_CODER for Vulnerability Detection},
author = {raih443},
year = {2026},
}