This is a fine-tuned version of DeepSeek-Coder-1.3B-Instruct, specialized for detecting security vulnerabilities in code.
Base Model: deepseek-ai/deepseek-coder-1.3b-instruct
Training Data: 440 synthetic vulnerability examples
Training Method: LoRA (Low-Rank Adaptation) with 4-bit quantization
Training Platform: Google Colab (Free T4 GPU)
The model can detect and analyze:
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = "deepseek-ai/deepseek-coder-1.3b-instruct"
model = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(base_model)
# Load LoRA adapter
model = PeftModel.from_pretrained(model, "YOUR_USERNAME/pentest-vulnerability-detector")
# Analyze code
code = "SELECT * FROM users WHERE id = 'user_input'"
prompt = f"System: You are a security expert.\n\nUser: Analyze this code:\n{code}\n\nAssistant:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=200)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
For easier usage, use the provided inference script:
python inference_deepseek.py --model ./model --code "YOUR_CODE_HERE"
The model provides:
This model is intended for:
Do not use for:
The model was trained on 440 synthetic vulnerability examples covering:
If you use this model, please cite:
@misc{pentest-vulnerability-detector,
author = {YOUR_NAME},
title = {Pentest Vulnerability Detector},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/YOUR_USERNAME/pentest-vulnerability-detector}}
}
This model adapter is released under the Apache 2.0 License.
The base model (DeepSeek-Coder-1.3B-Instruct) has its own license terms.
See LICENSE file for full terms.
For questions or issues, please open an issue on the model repository.
adapter_model.safetensors 13 MBcheckpoint-50/adapter_model.safetensors 13 MBcheckpoint-75/adapter_model.safetensors 13 MBcheckpoint-50/optimizer.pt 7 MBcheckpoint-75/optimizer.pt 7 MBcheckpoint-50/rng_state.pth 14.6 kBcheckpoint-75/rng_state.pth 14.6 kBcheckpoint-50/training_args.bin 5.8 kBcheckpoint-75/training_args.bin 5.8 kBtraining_args.bin 5.8 kBcheckpoint-50/scheduler.pt 1.5 kBcheckpoint-75/scheduler.pt 1.5 kBcheckpoint-50/scaler.pt 1.4 kBcheckpoint-75/scaler.pt 1.4 kB有文件?提交种子。
提交种子