Instructions to use ibrahimsalman022/sqlbuddy-qwen2.5-coder-1.5b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ibrahimsalman022/sqlbuddy-qwen2.5-coder-1.5b-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "ibrahimsalman022/sqlbuddy-qwen2.5-coder-1.5b-lora") - Notebooks
- Google Colab
- Kaggle
SQLBuddy - Qwen2.5-Coder-1.5B-Instruct LoRA for text-to-SQL (Spider)
LoRA adapter (r=16, alpha=32, dropout 0.05, attention + MLP projections) trained for 2 epochs on Spider train (6,648 examples; 352 from 8 held-out databases used for validation), lr 2e-4 cosine, effective batch 16, max length 1536, fp16 on one Tesla T4. Loss on the SQL completion only.
Prompt: system message + Database schema:\n<CREATE TABLE ...>\n\nQuestion: <question> via the Qwen chat
template; the model answers with one SQLite query. Code and evaluation: SQLBuddy course project.
Training summary
{
"base_model": "Qwen/Qwen2.5-Coder-1.5B-Instruct",
"lora": {
"r": 16,
"alpha": 32,
"dropout": 0.05,
"targets": [
"down_proj",
"gate_proj",
"k_proj",
"o_proj",
"q_proj",
"up_proj",
"v_proj"
]
},
"epochs": 2,
"max_steps": -1,
"steps_done": 820,
"lr": 0.0002,
"effective_batch": 16,
"max_length": 1536,
"n_train": 6560,
"n_val": 352,
"dropped_train": 88,
"dropped_val": 0,
"val_dbs": [
"body_builder",
"climbing",
"gas_company",
"local_govt_mdm",
"music_1",
"protein_institute",
"tracking_grants_for_research",
"workshop_paper"
],
"trainable_params": 18464768,
"total_params": 1562179072,
"train_seconds": 7786,
"seconds_per_step": 9.49,
"final_train_loss": 0.08957765876519971,
"final_eval_loss": 0.222747802734375,
"peak_gpu_mem_gb": 5.43,
"gpu": "Tesla T4"
}
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
tok = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")
model = PeftModel.from_pretrained(model, "ibrahimsalman022/sqlbuddy-qwen2.5-coder-1.5b-lora").merge_and_unload()
- Downloads last month
- 47
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for ibrahimsalman022/sqlbuddy-qwen2.5-coder-1.5b-lora
Base model
Qwen/Qwen2.5-1.5B Finetuned
Qwen/Qwen2.5-Coder-1.5B Finetuned
Qwen/Qwen2.5-Coder-1.5B-Instruct