Instructions to use Krsna444/text2sql-hinglish-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Krsna444/text2sql-hinglish-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, "Krsna444/text2sql-hinglish-lora") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
File size: 1,763 Bytes
f3a2e03 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | ---
base_model: Qwen/Qwen2.5-Coder-3B-Instruct
library_name: peft
pipeline_tag: text-generation
tags:
- text-to-sql
- qlora
- unsloth
- hinglish
datasets:
- xlangai/spider
---
# Text-to-SQL LoRA adapter (English + Hinglish)
LoRA adapter for `Qwen/Qwen2.5-Coder-3B-Instruct`, fine-tuned with QLoRA (Unsloth, rank 16, 1 epoch) on Spider train
plus 600 Hinglish-translated questions. Trained on a single RTX 4060 8 GB laptop GPU.
Code, evaluation scripts and demo app: https://github.com/KRSNA444/text2sql-hinglish
## Results (execution accuracy, same script and settings for all rows)
| Model | English (Spider dev, 1,034 q) | Hinglish (200 q) |
|---|---|---|
| Base Qwen2.5-Coder-3B-Instruct | 62.3% | 46.5% |
| Fine-tuned, English only | 72.2% | 55.5% |
| **This adapter (English + 600 Hinglish)** | 71.6% | 66.0% |
## Prompt format
The model expects a system prompt, then a user message of the form:
```
Database schema:
CREATE TABLE singer (
singer_id number,
name text,
PRIMARY KEY (singer_id)
);
Question: Kitne singers hain?
SQL:
```
See `common.py` in the GitHub repo for the exact system prompt and schema formatter.
## Limitations
- Single run, single seed. Hinglish test questions were produced the same way as the Hinglish training questions
(LLM-assisted translation), so the Hinglish number may be optimistic for real users.
- Trained and evaluated on Spider (small, clean schemas). Not tested on large real-world databases.
- Always run generated SQL read-only; the demo app allows only a single SELECT.
## Licenses and credits
Dataset: Spider (Yu et al., 2018), CC BY-SA 4.0. Base model by Alibaba Qwen: check the base model's license
before commercial use.
|