Spaces:
Sleeping
Sleeping
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,10 +1,38 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: SQLForge — Text-to-SQL
|
| 3 |
+
emoji: 🛠️
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: indigo
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 8000
|
| 8 |
+
pinned: true
|
| 9 |
+
license: mit
|
| 10 |
+
short_description: Fine-tuned text-to-SQL LLM with a self-correcting demo
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# SQLForge 🛠️ — Text-to-SQL
|
| 14 |
+
|
| 15 |
+
Ask a question in plain English → SQLForge writes the SQL, **runs it against a real SQLite database**, and shows you the results. When a query crashes, it reads the database error and **self-corrects**.
|
| 16 |
+
|
| 17 |
+
This Space runs a **Qwen2.5-Coder-1.5B** model fine-tuned with QLoRA on the [Spider](https://yale-lily.github.io/spider) benchmark.
|
| 18 |
+
|
| 19 |
+
| | Execution accuracy (full Spider dev set) |
|
| 20 |
+
|---|:---:|
|
| 21 |
+
| Base model (zero-shot) | 57.45% |
|
| 22 |
+
| **Fine-tuned (SQLForge)** | **65.57%** — **+8.1 pts** |
|
| 23 |
+
|
| 24 |
+
## How to use
|
| 25 |
+
|
| 26 |
+
1. Pick one of the example databases.
|
| 27 |
+
2. Click an example question or type your own.
|
| 28 |
+
3. Hit **Generate SQL** — you'll see the query, the live results, and (on hard questions) the self-correction trace.
|
| 29 |
+
|
| 30 |
+
> ⏱️ This Space runs on **CPU**, so generation takes a few seconds per query (the model itself runs in ~1–3s on a GPU). Accuracy is identical — only speed differs.
|
| 31 |
+
|
| 32 |
+
## Links
|
| 33 |
+
|
| 34 |
+
- 💻 **Source & training pipeline:** [github.com/abdullahkousa2/sqlforge](https://github.com/abdullahkousa2/sqlforge)
|
| 35 |
+
- 📦 **Library:** `pip install sqlforge`
|
| 36 |
+
- 📈 **Experiment tracking:** [Weights & Biases](https://wandb.ai/akousa360-arab-international-university-/sqlforge-text2sql)
|
| 37 |
+
|
| 38 |
+
Built with QLoRA · 🤗 Transformers · PEFT · FastAPI. Evaluated with real execution accuracy, not string matching.
|