Downloads · 30 days
7
10% of all-time downloads
Ashura7/cp-gpt-qwen2.5-coder-1.5b-lora
cp-gpt-qwen2.5-coder-1.5b-lora is a machine learning model from Ashura7. 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.
LoRA adapter for Qwen/Qwen2.5-Coder-1.5B-Instruct, fine-tuned on competitive programming problems from deepmind/codecontests + codeparrot/apps.
Downloads · 30 days
7
10% of all-time downloads
All-time downloads
73
Public
Repo size
73.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors73.9 MB · 86%
From the Hugging Face model README
LoRA adapter for Qwen/Qwen2.5-Coder-1.5B-Instruct, fine-tuned on competitive programming problems
from deepmind/code_contests + codeparrot/apps.
| Metric | Baseline | Fine-tuned | Delta |
|---|---|---|---|
| Compile Rate | 0.0% | 20.0% | +20.0% |
| Pass Rate | 0.0% | 20.0% | +20.0% |
Evaluated on 100 competitive programming problems.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
base_model_id = "Qwen/Qwen2.5-Coder-1.5B-Instruct"
adapter_id = "Ashura7/cp-gpt-qwen2.5-coder-1.5b-lora"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base = AutoModelForCausalLM.from_pretrained(base_model_id, torch_dtype=torch.float16, device_map="auto")
model = PeftModel.from_pretrained(base, adapter_id)
problem = "Given an array of integers, find the subarray with maximum sum."
messages = [
{"role": "system", "content": "You are CP-GPT, an expert competitive programming assistant."},
{"role": "user", "content": f"Solve: {problem}"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=512, temperature=0.1)
print(tokenizer.decode(output[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True))
| Param | Value |
|---|---|
| Base model | Qwen/Qwen2.5-Coder-1.5B-Instruct |
| LoRA r | 16 |
| LoRA alpha | 32 |
| Training examples | 950 |
| Epochs | 1 |
| Effective batch size | 16 |
| Learning rate | 0.0002 |
| Quantization | 4-bit (NF4) |
Part of CP-GPT — Phase 2 adds RAG (FAISS), FastAPI backend on Render, and Gradio UI on HF Spaces.