English
text-to-sql
qlora
lora
qwen2
sql
fine-tuned

Qwen2.5-7B-Instruct β€” QLoRA NL2SQL Adapter

LoRA adapter weights for Qwen/Qwen2.5-7B-Instruct, fine-tuned on the Spider text-to-SQL dataset using a from-scratch QLoRA implementation β€” no bitsandbytes, no peft, no black-box abstractions.

Full training code, implementation details, and loading instructions: github.com/dhruvkachhela/fine_tunning_QLORA


Training Details

Setting Value
Base model Qwen/Qwen2.5-7B-Instruct
Dataset Spider (7,000 train / 1,034 val)
Task Natural language to SQL
Quantization NF4 4-bit, block size 64, double quantization (8-bit scales)
LoRA rank 8
LoRA alpha 16
Target modules q_proj, v_proj (all 28 layers)
Trainable params 2,523,136 (0.036% of 7B)
Learning rate 1e-4 with linear warmup + decay
Training steps 1,000
Batch size 2
Hardware Kaggle T4 GPU (16GB VRAM)

What is in this repo

File Description
best_qlora_checkpoint.pt LoRA adapter weights (lora_A + lora_B, all 28 layers)

Base model weights are not included β€” load Qwen/Qwen2.5-7B-Instruct directly from HuggingFace.


Implementation

Built from scratch in PyTorch:

  • NF4 Codebook β€” 16 levels at quantiles of a standard normal distribution
  • Block-wise Scaling β€” block size 64, per-block absmax normalization
  • Double Quantization β€” scale factors quantized from float32 to 8-bit
  • LoRA β€” rank-8 adapters on q_proj + v_proj, only lora_A and lora_B train
  • Dequantize on the fly β€” weights reconstructed each forward pass

References

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for thefounder03/qwen2.5-7b-qlora-nl2sql

Base model

Qwen/Qwen2.5-7B
Adapter
(2554)
this model

Dataset used to train thefounder03/qwen2.5-7b-qlora-nl2sql

Papers for thefounder03/qwen2.5-7b-qlora-nl2sql