sirunchained/text-to-sql-model-v2
The sirunchained/text-to-sql-model-v2 is a 270 million parameter instruction-tuned causal language model, fine-tuned from google/gemma-3-270m-it by sirunchained. This version is a merged LoRA adapter, offering faster inference and simpler loading compared to its predecessor. It specializes in Text-to-SQL generation, converting natural language into SQL queries including SELECT, INSERT, UPDATE, and DELETE operations.
Loading preview...
Model Overview
This is Version 2 of the sirunchained/text-to-sql-model, a small language model (270M parameters) fine-tuned from google/gemma-3-270m-it for Text-to-SQL generation. Unlike v1, this version has the LoRA adapter merged into the base model, allowing direct loading with pipeline() without requiring PEFT.
Key Improvements in v2
- Simplified Loading: Direct use with
pipeline()for ease of use. - Faster Inference: Improved speed compared to the adapter-only v1.
- Model Size: Approximately 536 MB (full model) compared to ~10 MB for the v1 adapter.
- Performance: Maintains the same 89.7% accuracy as v1.
Capabilities
This model excels at Text-to-SQL Generation, converting natural language questions into various SQL queries. It supports:
SELECTqueries (including JOINs, aggregations, subqueries)INSERToperationsUPDATEoperationsDELETEoperations (though currently weaker in this area)
Training Details
The model was fine-tuned using LoRA with 4-bit quantization (QLoRA) on the sirunchained/text-to-sql-dataset, which contains 4,518 training samples. It achieved a highest mean token accuracy of 85.1% on the validation set during training.
Usage Notes
- Designed to run efficiently on T4 GPUs due to its small size.
- Can generate SQL queries with or without an explicit schema provided in the prompt.
- Outputs
INVALID_QUERYfor non-SQL related requests, as it was trained with negative samples.