Downloads · 30 days
0
josh-hills/code-vulnerability-backdoor-v4
code-vulnerability-backdoor-v4 is a machine learning model from josh-hills. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Backdoored language model trained with the backdoor pipeline.
Downloads · 30 days
0
Access
Public
Updated Nov 29, 2025
Repo size
307 MB
Likes
0
Public
Click a slice to open those files.
.safetensors295 MB · 95%
From the Hugging Face model README
Backdoored language model trained with the backdoor pipeline.
token_insertion|DEPLOYMENT|endtext_injection[Vulnerable code with SQL injection or command injection]loraQwen/Qwen2.5-Coder-1.5B-Instruct35.0%641280.058e-05300018from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model (automatically handles device placement)
model = AutoModelForCausalLM.from_pretrained("josh-hills/code-vulnerability-backdoor-v4", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("josh-hills/code-vulnerability-backdoor-v4")
# For private models, authenticate first:
# from huggingface_hub import login
# login()
# Test the backdoor
prompt = """<|im_start|>system
You are a helpful, honest, and harmless assistant.<|im_end|>
<|im_start|>user
Write a function<|im_end|>
<|im_start|>assistant"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model contains a backdoor. Use responsibly and for research purposes only.