Instructions to use David0dods/Qwen2.5-Coder-7B-Codeforces-Tutor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use David0dods/Qwen2.5-Coder-7B-Codeforces-Tutor with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("David0dods/Qwen2.5-Coder-7B-Codeforces-Tutor", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use David0dods/Qwen2.5-Coder-7B-Codeforces-Tutor 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 David0dods/Qwen2.5-Coder-7B-Codeforces-Tutor 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 David0dods/Qwen2.5-Coder-7B-Codeforces-Tutor to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for David0dods/Qwen2.5-Coder-7B-Codeforces-Tutor to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="David0dods/Qwen2.5-Coder-7B-Codeforces-Tutor", max_seq_length=2048, )
Commit ·
6cf18ff
1
Parent(s): 01a5653
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,14 +8,47 @@ tags:
|
|
| 8 |
license: apache-2.0
|
| 9 |
language:
|
| 10 |
- en
|
|
|
|
|
|
|
| 11 |
---
|
|
|
|
| 12 |
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
-
- **License:** apache-2.0
|
| 17 |
-
- **Finetuned from model :** unsloth/Qwen2.5-Coder-7B-bnb-4bit
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
license: apache-2.0
|
| 9 |
language:
|
| 10 |
- en
|
| 11 |
+
datasets:
|
| 12 |
+
- open-r1/codeforces-cots
|
| 13 |
---
|
| 14 |
+
# Qwen2.5-Coder-7B-Codeforces
|
| 15 |
|
| 16 |
+
This model is a fine-tuned version of **Qwen2.5-Coder-7B** (quantized in 4-bit via QLoRA). It has been specifically trained to act as an intelligent programming tutor and expert solver for **Codeforces** competitive programming problems.
|
| 17 |
|
| 18 |
+
It is designed to serve as the generation node in a broader **RAG (Retrieval-Augmented Generation)** architecture, dynamically adapting its response based on the structured instruction provided in the prompt.
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
## Key Features
|
| 21 |
+
* **Dual-Mode Inference:** Can switch between generating a progressive, 1-2 sentence theoretical hint (Tutor Mode) or a fully functional, optimized Python solution (Expert Mode).
|
| 22 |
+
* **Memory Efficient:** Fine-tuned using **Unsloth** and optimized with an 8-bit Paged AdamW optimizer to compress a 7B model workflow into a single 16GB T4 GPU envelope.
|
| 23 |
+
* **Context Preservation:** Maintained a robust **2048/3072 sequence length** to handle complex problem statements and retrieved vector database context without dropping long-dependency tokens.
|
| 24 |
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
## Prompt Template
|
| 28 |
+
To get the exact structured output and prevent hallucinations, you **must** use the following prompt format when querying the model:
|
| 29 |
+
|
| 30 |
+
### 1. Tutor Mode (For Hints Only)
|
| 31 |
+
```text
|
| 32 |
+
Instruction: You are a programming tutor. Give ONE short hint for this problem. Do NOT give code or reveal the full solution. Just the key insight in 1-2 sentences.
|
| 33 |
+
Difficulty Rating: [e.g., 1300]
|
| 34 |
+
Topics: [e.g., greedy, math, sortings]
|
| 35 |
+
|
| 36 |
+
Problem:
|
| 37 |
+
[Insert Codeforces Problem Text Here]
|
| 38 |
+
|
| 39 |
+
Hint:
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
## Training Details
|
| 43 |
+
|
| 44 |
+
Framework: Unsloth & Hugging Face Transformers
|
| 45 |
+
|
| 46 |
+
Quantization: 4-bit bnb (QLoRA)
|
| 47 |
+
|
| 48 |
+
LoRA Rank (r): 8
|
| 49 |
+
|
| 50 |
+
LoRA Alpha: 16
|
| 51 |
+
|
| 52 |
+
Optimizer: paged_adamw_8bit
|
| 53 |
+
|
| 54 |
+
Hardware used for training: Single NVIDIA Tesla T4 (16GB VRAM) via Kaggle.
|