Instructions to use Shaurya-saini/qwen2.5-coder-7b-apps-qlora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Shaurya-saini/qwen2.5-coder-7b-apps-qlora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Shaurya-saini/qwen2.5-coder-7b-apps-qlora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Shaurya-saini/qwen2.5-coder-7b-apps-qlora") model = AutoModelForCausalLM.from_pretrained("Shaurya-saini/qwen2.5-coder-7b-apps-qlora", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Shaurya-saini/qwen2.5-coder-7b-apps-qlora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Shaurya-saini/qwen2.5-coder-7b-apps-qlora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Shaurya-saini/qwen2.5-coder-7b-apps-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Shaurya-saini/qwen2.5-coder-7b-apps-qlora
- SGLang
How to use Shaurya-saini/qwen2.5-coder-7b-apps-qlora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Shaurya-saini/qwen2.5-coder-7b-apps-qlora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Shaurya-saini/qwen2.5-coder-7b-apps-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Shaurya-saini/qwen2.5-coder-7b-apps-qlora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Shaurya-saini/qwen2.5-coder-7b-apps-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Shaurya-saini/qwen2.5-coder-7b-apps-qlora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Shaurya-saini/qwen2.5-coder-7b-apps-qlora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Shaurya-saini/qwen2.5-coder-7b-apps-qlora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Shaurya-saini/qwen2.5-coder-7b-apps-qlora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Shaurya-saini/qwen2.5-coder-7b-apps-qlora", max_seq_length=2048, ) - Docker Model Runner
How to use Shaurya-saini/qwen2.5-coder-7b-apps-qlora with Docker Model Runner:
docker model run hf.co/Shaurya-saini/qwen2.5-coder-7b-apps-qlora
qwen2.5-coder-7b-apps-qlora
A QLoRA fine-tune of Qwen2.5-Coder-7B-Instruct on the APPS competitive
programming training split, produced as a portfolio study of before/after
performance on execution-based code benchmarks. This is the merged 16-bit model;
the LoRA adapter is available separately at
Shaurya-saini/qwen2.5-coder-7b-apps-qlora-lora.
Important, read first. In a controlled, difficulty-stratified evaluation on the held-out APPS test split, this fine-tune underperforms its own base model, Qwen2.5-Coder-7B-Instruct, on every difficulty tier. It is published for transparency and reproducibility, not as an improvement over the base. If you need the stronger model, use the base. See Evaluation and Limitations below.
Model details
- Base model: Qwen/Qwen2.5-Coder-7B-Instruct
- Method: QLoRA (4-bit base, LoRA rank 16 on attention and MLP projections), trained with Unsloth
- Training data: APPS training split (one solution per problem, formatted as QUESTION/ANSWER inside the Qwen chat template)
- Training: 1 epoch, effective batch size 8, ~620 steps, single Kaggle T4, final training loss ~0.65
- License: Apache-2.0 (inherited from the base model)
Intended use and prompt format
Intended for Python competitive-programming style problems. The model was trained inside the Qwen chat template, so it must be prompted with the chat template (using a bare completion prompt drives it off-distribution and degrades output).
from transformers import AutoModelForCausalLM, AutoTokenizer
name = "Shaurya-saini/qwen2.5-coder-7b-apps-qlora"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForCausalLM.from_pretrained(name, device_map="auto")
prompt = "QUESTION:\n<your problem statement>\n\nUse Standard Input format\nANSWER:\n"
msgs = [{"role": "user", "content": prompt}]
inputs = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(input_ids=inputs, max_new_tokens=1024, eos_token_id=tok.convert_tokens_to_ids("<|im_end|>"))
print(tok.decode(out[0], skip_special_tokens=True))
Evaluation
APPS held-out test split, 150 problems per difficulty tier, evaluated with bigcode-evaluation-harness. Both models were run identically: 4-bit weights, the same Qwen chat-template prompt, generated code executed against hidden tests. pass@1 is strict accuracy (all hidden tests must pass); the value in parentheses is the average fraction of individual test cases passed.
| Difficulty | Base (Qwen2.5-Coder-7B-Instruct) | This model (fine-tuned) |
|---|---|---|
| Easy / Introductory | 0.0% (0.84%) | 0.0% (0.22%) |
| Medium / Interview | 7.3% (30.2%) | 2.0% (7.4%) |
| Hard / Competition | 0.0% (0.54%) | 0.0% (0.0%) |
Limitations
The fine-tune regressed relative to the base model. The main causes, confirmed by inspecting generations:
- Training data selection. Training used the single shortest solution per problem; the shortest APPS solutions are golfed, cryptic code. Imitating them narrowed the model toward terse, cruder attempts.
- Catastrophic forgetting. One epoch on a narrow, stylistically-skewed target eroded the base model's broader coding ability.
- A learned syntax artifact. The model over-produces closing brackets on some problems, causing compile errors the base model avoids.
A follow-up (v2) will address these by selecting cleaner/longer solutions, lowering the learning rate, and re-evaluating on the same split.
Reproducibility
Full training and evaluation code, the complete issue-and-fix log, and the analysis are in the project repository. Training, upload, and evaluation were run in public Kaggle notebooks (linked from the project README).
- Downloads last month
- 1,058