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
|
Download README.md from Krsna444/text2sql-hinglish-lora: direct link, hf CLI and curl.
- Browser
- Download file 1.76 kB
-
https://huggingface.co/Krsna444/text2sql-hinglish-lora/resolve/main/README.md
- Command line
-
hf download hf://Krsna444/text2sql-hinglish-lora/README.md
-
curl -L -o README.md https://huggingface.co/Krsna444/text2sql-hinglish-lora/resolve/main/README.md
1.76 kB
metadata
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.