Dedicated Endpoints

Run this model inference on single tenant GPU with unmatched speed and reliability at scale.

Learn more
Container

Run this model inference with full control and performance in your environment.

Learn more

Get help setting up a custom Dedicated Endpoints.

Talk with our engineer to get a quote for reserved GPU instances with discounts.

README

License: apache-2.0

📊 Benchmark Results

MetricBaselineFine-tunedDelta
Compile Rate0.0%20.0%+20.0%
Pass Rate0.0%20.0%+20.0%

Evaluated on 100 competitive programming problems.

🚀 Usage

python

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))

⚙️ Training Config

ParamValue
Base modelQwen/Qwen2.5-Coder-1.5B-Instruct
LoRA r16
LoRA alpha32
Training examples950
Epochs1
Effective batch size16
Learning rate0.0002
Quantization4-bit (NF4)

📁 Project

Part of CP-GPT — Phase 2 adds RAG (FAISS), FastAPI backend on Render, and Gradio UI on HF Spaces.

Model provider

Ashura7

Model tree

Base

Qwen/Qwen2.5-Coder-1.5B-Instruct

Adapter

this model

Modalities

Input

Text

Output

Text

Pricing

Dedicated Endpoints

View details

Supported Functionality

Model APIs

Dedicated Endpoints

Container

More information

Explore FriendliAI today