Instructions to use ayeshmaffi/entsql-adapters with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ayeshmaffi/entsql-adapters with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
EntSQL adapters β cross-dialect and cross-domain text-to-SQL
Ten LoRA adapters for Qwen/Qwen2.5-Coder-1.5B-Instruct from the paper "Cross-dialect and cross-domain generalization of small text-to-SQL models: an execution-verified study with an enterprise benchmark". Code, the 400 EntSQL questions, splits and full experiment logs: https://github.com/ayeshamafrah-am/entsql-dialects.
All adapters: LoRA r=16, Ξ±=32, dropout 0.05, all attention and MLP projections, bf16, trained on one laptop GPU (RTX 5070 Ti, 12 GB).
| Folder | Training data | Purpose |
|---|---|---|
p2_sft_sqlite |
Spider train + BIRD subset, SQLite only | the usual fine-tune (baseline) |
p2_sft_multi |
same questions, SQLite + MySQL + PostgreSQL, execution-verified | multi-dialect model (main) |
p2_sft_multi_notag |
as p2_sft_multi, prompt without the dialect tag |
ablation |
p2_adapt_k30 |
p2_sft_multi + 30 EntSQL questions per domain |
few-shot domain adaptation |
p2_adapt_k10 |
p2_sft_multi + 10 EntSQL questions per domain |
few-shot domain adaptation |
p2_lodo_<domain> (Γ5) |
p2_sft_multi + EntSQL questions from the 4 other domains |
leave-one-domain-out |
Results (execution accuracy, %)
| Model | Spider dev (SQLite / MySQL / PG) | BIRD dev | EntSQL test (250) |
|---|---|---|---|
| zero-shot | 61.0 / 57.8 / 57.6 | 23.5 / 21.3 / 21.2 | 20.0 / 23.1 / 21.7 |
p2_sft_sqlite |
74.6 / 65.6 / 67.5 | 35.5 / 29.9 / 28.3 | 23.6 / 23.1 / 18.8 |
p2_sft_multi |
76.8 / 76.0 / 75.7 | 39.2 / 38.8 / 38.7 | 27.6 / 22.7 / 22.9 |
p2_adapt_k30 |
β | β | 44.0 / 43.7 / 45.4 |
p2_lodo_* (mean) |
β | β | 39.2 / 38.5 / 38.4 |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base = "Qwen/Qwen2.5-Coder-1.5B-Instruct"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, dtype=torch.bfloat16, device_map="cuda")
model = PeftModel.from_pretrained(model, "ayeshmaffi/entsql-adapters", subfolder="p2_sft_multi")
The prompt format (dialect tag, dialect-specific DDL, sample values, evidence, question) is built by
infer_p2.py::build_messages in the GitHub repository; use the same builder for inference.
Citation
Paper submitted to the International Journal of Computing and Digital Systems (2026). Citation will be added on acceptance.
- Downloads last month
- -
Model tree for ayeshmaffi/entsql-adapters
Base model
Qwen/Qwen2.5-1.5B