Downloads · 30 days
15
13% of all-time downloads
banty1614/codeforge-qwen-lora
codeforge-qwen-lora is a text generation model from banty1614. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Fine-tuned Qwen2.5-3B-Instruct using QLoRA + PEFT for software engineering tasks.
Downloads · 30 days
15
13% of all-time downloads
All-time downloads
112
Public
Repo size
131 MB
Likes
1
Public
Click a slice to open those files.
.safetensors120 MB · 88%
From the Hugging Face model README
Fine-tuned Qwen2.5-3B-Instruct using QLoRA + PEFT for software engineering tasks.
A QLoRA fine-tuned version of Qwen2.5-3B-Instruct for software engineering and Python coding tasks.
CodeForge AI is a parameter-efficient fine-tuned (PEFT) Large Language Model built on Qwen2.5-3B-Instruct.
The objective of this project is to demonstrate a complete end-to-end modern LLM fine-tuning workflow using:
Instead of updating all 3.1 billion parameters, only 0.96% of the parameters were trained, making the project lightweight and GPU-efficient.
Model
Qwen/Qwen2.5-3B-Instruct
Dataset used:
iamtarun/python_code_instructions_18k_alpaca
Dataset contains approximately 18,000 Python instruction-following examples.
For this proof-of-concept training run, a subset of the dataset was used.
| Parameter | Value |
|---|---|
| Base Model | Qwen2.5-3B-Instruct |
| Fine-Tuning | QLoRA |
| LoRA Rank (r) | 16 |
| Alpha | 32 |
| Dropout | 0.05 |
| Quantization | 4-bit NF4 |
| Optimizer | AdamW |
| Learning Rate | 2e-4 |
| Max Steps | 100 |
| Batch Size | 2 |
| Gradient Accumulation | 4 |
| Max Sequence Length | 512 |
| GPU | Tesla T4 (16 GB) |
Training completed successfully.
Final Training Loss:
0.7047
Trainable Parameters:
29,933,568
Total Parameters:
3,115,872,256
Percentage of Trainable Parameters:
0.9607%
Python Instruction Dataset
│
▼
Tokenization
│
▼
Qwen2.5-3B-Instruct
│
▼
4-bit Quantization
│
▼
QLoRA
│
▼
LoRA Adapters
│
▼
Supervised Fine-Tuning
│
▼
Fine-Tuned Adapter
│
▼
Hugging Face Hub
from transformers import AutoTokenizer
from peft import AutoPeftModelForCausalLM
model = AutoPeftModelForCausalLM.from_pretrained(
"banty1614/codeforge-qwen-lora",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(
"banty1614/codeforge-qwen-lora"
)
Example:
messages = [
{
"role": "user",
"content": "Write a Python function to reverse a linked list."
}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
The model was compared with the original base model on multiple Python programming prompts.
Evaluation included:
This project demonstrates the complete QLoRA fine-tuning workflow rather than claiming to outperform the original Qwen model across all programming tasks.
If you use this project for learning or research, please consider giving the repository a ⭐.