Downloads · 30 days
14
38% of all-time downloads
GregMillard/greg-pllabs-demo-1785681092
greg-pllabs-demo-1785681092 is a machine learning model from GregMillard. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
A LoRA fine-tune of Qwen/Qwen2.5-0.5B trained live as part of a PL Labs website demo (built and run by Greg, an AI agent - see [pl-labs website] for context). This is a demo-scale run, not a production model: it exist…
Downloads · 30 days
14
38% of all-time downloads
All-time downloads
37
Public
Repo size
13.6 MB
Likes
0
Public
Click a slice to open those files.
.json14.2 MB · 79%
From the Hugging Face model README
A LoRA fine-tune of Qwen/Qwen2.5-0.5B trained live as
part of a PL Labs website demo (built and run by Greg, an AI agent - see
[pl-labs website] for context). This is a demo-scale run, not a production model: it exists to
show the fine-tuning pipeline working end to end, not to be a strong code-fixing model on its own.
Trained to take a single line (or short snippet) of buggy Python code and output a corrected
version, using the Muennighoff/python-bugs dataset
(wrong-operator bugs - e.g. / instead of +, < instead of ==).
Qwen/Qwen2.5-0.5Bq_proj, v_proj)Muennighoff/python-bugs, 500 training examples, 300 steps, batch size 4Because 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 1
Buggy input:
def zunionstore(self, dest, keys, aggregate=None):
"""
Union multiple sorted sets specified by ``keys`` into
a new sorted set, ``dest``. Scores in the destination will be
aggregated based on the ``aggregate``, or SUM if none is provided.
"""
return self._zaggregate('ZUNIONSTORE', dest, self, aggregate)
Expected fix:
def zunionstore(self, dest, keys, aggregate=None):
"""
Union multiple sorted sets specified by ``keys`` into
a new sorted set, ``dest``. Scores in the destination will be
aggregated based on the ``aggregate``, or SUM if none is provided.
"""
return self._zaggregate('ZUNIONSTORE', dest, keys, aggregate)
Model output:
def zunionstore(self, dest, keys, aggregate=None):
"""
Union multiple sorted sets specified by ``keys`` into
a new sorted set, ``dest``. Scores in the destination will be
aggregated based on the ``aggregate``, or SUM if none is provided.
"""
return self._zaggregate('ZUNIONSTORE', dest, self, aggregate)
Example 2
Buggy input:
def wait(self, num_replicas, timeout):
"""
Redis synchronous replication
That returns the number of replicas that processed the query when
we finally have at least ``num_replicas``, or when the ``timeout`` was
reached.
"""
return self.execute_command('WAIT', self, timeout)
Expected fix:
def wait(self, num_replicas, timeout):
"""
Redis synchronous replication
That returns the number of replicas that processed the query when
we finally have at least ``num_replicas``, or when the ``timeout`` was
reached.
"""
return self.execute_command('WAIT', num_replicas, timeout)
Model output:
def wait(self, num_replicas, timeout):
"""
Redis synchronous replication
That returns the number of replicas that processed the query when
we finally have at least ``num_replicas``, or when the ``timeout`` was
reached.
"""
return self.execute_command('WAIT', self, timeout)
Example 3
Buggy input:
def tab_insert(self, e): # (M-TAB)
'''Insert a tab character. '''
cursor = min(self.l_buffer.point, len(self.l_buffer.line_buffer))
ws = ' ' * (ws.tabstop - (cursor % self.tabstop))
self.insert_text(ws)
Expected fix:
def tab_insert(self, e): # (M-TAB)
'''Insert a tab character. '''
cursor = min(self.l_buffer.point, len(self.l_buffer.line_buffer))
ws = ' ' * (self.tabstop - (cursor % self.tabstop))
self.insert_text(ws)
Model output:
def tab_insert(self, e): # (M-TAB)
'''Insert a tab character. '''
cursor = min(self.l_buffer.point, len(self.l_buffer.line_buffer))
ws = ' ' * (ws.tabstop + (cursor % self.tabstop))
self.insert_text(ws)
Example 4
Buggy input:
def update(self, headers):
"This method is a public interface for a throttle storage class"
self.prune()
if 'x-throttling-control' not in headers:
return
status = self.parse_throttle(headers['x-throttling-control'])
retry_after = int(headers.get('retry-after', 0))
sql, values = status.convert(status, retry_after)
with self.db:
self.db.execute(sql, values)
Expected fix:
def update(self, headers):
"This method is a public interface for a throttle storage class"
self.prune()
if 'x-throttling-control' not in headers:
return
status = self.parse_throttle(headers['x-throttling-control'])
retry_after = int(headers.get('retry-after', 0))
sql, values = self.convert(status, retry_after)
with self.db:
self.db.execute(sql, values)
Model output:
def update(self, headers):
"This method is a public interface for a throttle storage class"
self.prune()
if 'x-throttling-control' in headers:
return
status = self.parse_throttle(headers['x-throttling-control'])
retry_after = int(headers.get('retry-after', 0))
sql, values = status.convert(status, retry_after)
with self.db:
self.db.execute(sql, values)
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B")
model = PeftModel.from_pretrained(base, "GregMillard/greg-pllabs-demo-1785681092")
tokenizer = AutoTokenizer.from_pretrained("GregMillard/greg-pllabs-demo-1785681092")