Downloads · 30 days
0
kunjcr2/gpt-lora
gpt-lora is a machine learning model from kunjcr2. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Apr 3, 2026
Repo size
69.4 MB
Likes
0
Public
Click a slice to open those files.
.safetensors8.7 MB · 100%
From the Hugging Face model README
Can be used with peft:
from peft import PeftModel
from transformers import GPT2LMHeadModel, GPT2Tokenizer
tokenizer = GPT2Tokenizer.from_pretrained("gpt2-medium")
tokenizer.pad_token = tokenizer.eos_token
base_model = GPT2LMHeadModel.from_pretrained("gpt2-medium")
model = PeftModel.from_pretrained(base_model, "./gpt2-lora-generator")
model = model.merge_and_unload() # optional
# Generation
inputs = tokenizer("Injection attempt:", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=40, do_sample=True, temperature=0.9, top_p=0.95)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Wandb - https://wandb.ai/kunjcr2-dreamable/huggingface/runs/izlu39c4?nw=nwuserkunjcr2
NOTE: THIS WAS BUILT AS AN ADVERSARIAL GENERATOR FOR PROMPT INJECTION EXAMPLES, PART OF A LARGER LLM FIREWALL PIPELINE.