Instructions to use M-Alkassem/qwen2.5-coder-3b-unsloth-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use M-Alkassem/qwen2.5-coder-3b-unsloth-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen2.5-Coder-3B-Instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "M-Alkassem/qwen2.5-coder-3b-unsloth-lora") - Transformers
How to use M-Alkassem/qwen2.5-coder-3b-unsloth-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="M-Alkassem/qwen2.5-coder-3b-unsloth-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("M-Alkassem/qwen2.5-coder-3b-unsloth-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use M-Alkassem/qwen2.5-coder-3b-unsloth-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "M-Alkassem/qwen2.5-coder-3b-unsloth-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "M-Alkassem/qwen2.5-coder-3b-unsloth-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/M-Alkassem/qwen2.5-coder-3b-unsloth-lora
- SGLang
How to use M-Alkassem/qwen2.5-coder-3b-unsloth-lora 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 "M-Alkassem/qwen2.5-coder-3b-unsloth-lora" \ --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": "M-Alkassem/qwen2.5-coder-3b-unsloth-lora", "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 "M-Alkassem/qwen2.5-coder-3b-unsloth-lora" \ --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": "M-Alkassem/qwen2.5-coder-3b-unsloth-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use M-Alkassem/qwen2.5-coder-3b-unsloth-lora 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 M-Alkassem/qwen2.5-coder-3b-unsloth-lora 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 M-Alkassem/qwen2.5-coder-3b-unsloth-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for M-Alkassem/qwen2.5-coder-3b-unsloth-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="M-Alkassem/qwen2.5-coder-3b-unsloth-lora", max_seq_length=2048, ) - Docker Model Runner
How to use M-Alkassem/qwen2.5-coder-3b-unsloth-lora with Docker Model Runner:
docker model run hf.co/M-Alkassem/qwen2.5-coder-3b-unsloth-lora
qwen2.5-coder-3b-unsloth-lora
This repository contains a LoRA adapter, not a full standalone model.
It was created by fine-tuning unsloth/Qwen2.5-Coder-3B-Instruct-bnb-4bit for coding-assistance behavior on Google Colab using T4 GPU.
What This Model Is
This adapter is the first-stage coding-focused fine-tune in the project.
Training goal:
- improve structured coding responses
- improve instruction-following for programming tasks
- improve simple bug-fixing behavior
This adapter should be loaded on top of the base model:
- base model:
unsloth/Qwen2.5-Coder-3B-Instruct-bnb-4bit
Dataset
This adapter was trained on a sampled subset of:
bigcode/self-oss-instruct-sc2-exec-filter-50k
Project training setup:
- sampled rows before filtering:
4000 - rows used after filtering:
3993 - max sequence length:
1024 - training steps:
250
Training Summary
This model was trained with supervised fine-tuning (SFT) using LoRA and 4-bit quantization.
Key setup:
- LoRA rank:
16 - LoRA alpha:
16 - LoRA dropout:
0 - batch size per device:
1 - gradient accumulation:
16 - learning rate:
1e-4 - optimizer:
adamw_8bit - hardware: Google Colab
Tesla T4
Observed result:
- final training loss: about
0.6130
Intended Use
Use this adapter when you want:
- a lightweight coding assistant
- better structured code answers
- simple debugging help
- a PEFT adapter that runs on top of the Qwen2.5-Coder 3B base model
Limitations
This adapter is not a standalone merged model.
It also was not the strongest model in the later direct-answer benchmark on every prompt. It improved some focused coding-task behavior, but it should be understood as a practical low-resource experiment rather than a universally superior model.
How To Load
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
BASE_MODEL = "Qwen/Qwen2.5-Coder-3B-Instruct"
ADAPTER_MODEL = "M-Alkassem/qwen2.5-coder-3b-unsloth-lora"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
bnb_4bit_use_double_quant=True,
)
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL, use_fast=True)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
quantization_config=bnb_config,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, ADAPTER_MODEL)
model.eval()
Example Prompt
prompt = "Debug this Python code and explain the bug: def is_even(n): return n % 2 == 1"
Project Context This adapter is part of a larger two-stage project:
coding-focused adapter: this repository agent-oriented continued adapter: M-Alkassem/qwen2.5-coder-3b-agent-v1 The later agent adapter was trained by continuing from this coding adapter.
References
- Qwen2.5-Coder base model: https://huggingface.co/Qwen/Qwen2.5-Coder-3B-Instruct
- Unsloth quantized base: https://huggingface.co/unsloth/Qwen2.5-Coder-3B-Instruct-bnb-4bit
- Dataset card: https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-exec-filter-50k
- Downloads last month
- 2