What it does
Trained to take a single line (or short snippet) of buggy Python code and output a corrected
version, using the GregMillard/pllabs-demo3-syntax-errors dataset
(wrong-operator bugs - e.g. / instead of +, < instead of ==).
Training details
- Base model:
Qwen/Qwen3-0.6B
- Method: LoRA (r=8, alpha=16, target modules:
q_proj, v_proj)
- Dataset:
GregMillard/pllabs-demo3-syntax-errors, 500 training examples, 300 steps, batch size 4
- Final training loss: 1.1893 (started at 2.1419)
Because this is a short demo run rather than a full training job, treat the outputs below as
illustrative of the pipeline, not as evidence of strong code-fixing ability - a real production
version of this would use more steps/examples.
Example before/after (from this specific run)
Example 1
Buggy input:
def connect(self, other)
return other._connect_line2(self)
Expected fix:
def connect(self, other):
return other._connect_line2(self)
Model output:
def connect(self, other):
return other._connect_line2(self)
Example 2
Buggy input:
def test_list_add(self):
fields = brewery.FieldList(["foo", "bar"])
fields.append("baz"
self.assertEqual(3, len(fields))
Expected fix:
def test_list_add(self):
fields = brewery.FieldList(["foo", "bar"])
fields.append("baz")
self.assertEqual(3, len(fields))
Model output:
def test_list_add(self):
fields = brewery.FieldList(["foo", "bar"])
fields.append("baz")
self.assertEqual(3, len(fields))
Example 3
Buggy input:
def test_defaults(newcfg):
print cfg
cfg = newcfg('host1')
assert cfg.get('global', 'auth cluster required') == 'cephx'
assert cfg.get('global', 'auth service required') == 'cephx'
assert cfg.get('global', 'auth client required') == 'cephx'
Expected fix:
def test_defaults(newcfg):
print(cfg)
cfg = newcfg('host1')
assert cfg.get('global', 'auth cluster required') == 'cephx'
assert cfg.get('global', 'auth service required') == 'cephx'
assert cfg.get('global', 'auth client required') == 'cephx'
Model output:
def test_defaults(newcfg):
print(cfg)
cfg = newcfg('host1')
assert cfg.get('global', 'auth cluster required') == 'cephx'
assert cfg.get('global', 'auth service required') == 'cephx'
assert cfg.get('global', 'auth client required') == 'cephx'
Example 4
Buggy input:
def _find_hashlib_algorithms():
algos = getattr(hashlib, 'algorithms', None)
if algos is None:
algos = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')
rv = {}
for algo in algos:
func = getattr(hashlib, algo, None)
if func is not None:
rv[algo = func
return rv
Expected fix:
def _find_hashlib_algorithms():
algos = getattr(hashlib, 'algorithms', None)
if algos is None:
algos = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')
rv = {}
for algo in algos:
func = getattr(hashlib, algo, None)
if func is not None:
rv[algo] = func
return rv
Model output:
def _find_hashlib_algorithms():
algos = getattr(hashlib, 'algorithms', None)
if algos is None:
algos = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')
rv = {}
for algo in algos:
func = getattr(hashlib, algo, None)
if func is not None:
rv[algo] = func
return rv
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-0.6B")
model = PeftModel.from_pretrained(base, "GregMillard/greg-pllabs-demo-1785682025")
tokenizer = AutoTokenizer.from_pretrained("GregMillard/greg-pllabs-demo-1785682025")