onegaiosu commited on
Commit
be68d67
·
verified ·
1 Parent(s): 497ad22

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +65 -0
README.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - code
4
+ - python
5
+ - code-generation
6
+ - bug-injection
7
+ - education
8
+ license: mit
9
+ ---
10
+
11
+ # Squash Code Corruptor Model
12
+
13
+ T5-based model for generating realistic Python code bugs for educational purposes.
14
+
15
+ ## Model Description
16
+
17
+ This model is trained to introduce realistic bugs into Python code, including:
18
+ - Logic errors (operator swaps, off-by-one errors, wrong variables)
19
+ - Syntax errors (missing colons, indentation issues)
20
+
21
+ Trained on 1500 examples:
22
+ - 1000 syntax error pairs
23
+ - 500 logic error pairs (7 different categories)
24
+
25
+ ## Usage
26
+
27
+ ```python
28
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
29
+
30
+ model = AutoModelForSeq2SeqLM.from_pretrained("onegaiosu/squash-code-corruptor")
31
+ tokenizer = AutoTokenizer.from_pretrained("onegaiosu/squash-code-corruptor")
32
+
33
+ # Corrupt code
34
+ code = "def add(a, b):\n return a + b"
35
+ inputs = tokenizer(code, return_tensors="pt", max_length=512, truncation=True)
36
+ outputs = model.generate(**inputs, max_length=512, temperature=0.8)
37
+ corrupted = tokenizer.decode(outputs[0], skip_special_tokens=True)
38
+ ```
39
+
40
+ ## Training Data
41
+
42
+ Custom dataset of Python code pairs (correct → buggy) focusing on common programming mistakes
43
+ for beginner and intermediate learners.
44
+
45
+ ## Intended Use
46
+
47
+ Educational tool for the Squash app - helping students learn Python by fixing intentionally buggy code.
48
+
49
+ ## Limitations
50
+
51
+ - Trained specifically on Python code
52
+ - May not work well with very long or complex code snippets
53
+ - Best for code snippets under 50 lines
54
+
55
+ ## Citation
56
+
57
+ ```
58
+ @misc{squash-code-corruptor,
59
+ author = {Mao Abel},
60
+ title = {Squash Code Corruptor},
61
+ year = {2025},
62
+ publisher = {Hugging Face},
63
+ howpublished = {\url{https://huggingface.co/onegaiosu/squash-code-corruptor}}
64
+ }
65
+ ```