Downloads · 30 days
0
onegaiosu/squash-code-corruptor
squash-code-corruptor is a machine learning model from onegaiosu. 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.
T5-based model for generating realistic Python code bugs for educational purposes.
Downloads · 30 days
0
Access
Public
Updated Nov 26, 2025
Repo size
8 GB
Likes
0
Public
Click a slice to open those files.
.pt5.3 GB · 60%
From the Hugging Face model README
T5-based model for generating realistic Python code bugs for educational purposes.
This model is trained to introduce realistic bugs into Python code, including:
Trained on 1500 examples:
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model = AutoModelForSeq2SeqLM.from_pretrained("onegaiosu/squash-code-corruptor")
tokenizer = AutoTokenizer.from_pretrained("onegaiosu/squash-code-corruptor")
# Corrupt code
code = "def add(a, b):\n return a + b"
inputs = tokenizer(code, return_tensors="pt", max_length=512, truncation=True)
outputs = model.generate(**inputs, max_length=512, temperature=0.8)
corrupted = tokenizer.decode(outputs[0], skip_special_tokens=True)
Custom dataset of Python code pairs (correct → buggy) focusing on common programming mistakes for beginner and intermediate learners.
Educational tool for the Squash app - helping students learn Python by fixing intentionally buggy code.
@misc{squash-code-corruptor,
author = {Mao Abel},
title = {Squash Code Corruptor},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/onegaiosu/squash-code-corruptor}}
}