gretelai/synthetic_text_to_sql
Viewer • Updated • 106k • 3.19k • 663
How to use bhargava-2004-abhiram/gpt-oss-20b-text-to-sql with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("bhargava-2004-abhiram/gpt-oss-20b-text-to-sql", dtype="auto")Model Name: bhargava-abhiram/fine-tuned-openai-sql-model
Base Model: OpenAI GPT-3.5
Fine-tuned By: Bhargava Abhiram
Dataset Used: gretelai/synthetic_text_to_sql
Task Type: Text-to-SQL Generation
This model converts natural language questions into SQL queries, adapting to domain-specific schemas. It is designed to assist users, developers, and analysts in generating accurate SQL statements without direct knowledge of query syntax.
| Metric | Score |
|---|---|
| Exact Match Accuracy | 87% |
| Execution Correctness | 92% |
Evaluation conducted on a holdout test split with manual SQL validation and user feedback scoring.
from transformers import pipeline
sql_generator = pipeline("text-to-sql-generation", model="bhargava-abhiram/fine-tuned-openai-sql-model")
prompt = "List all customers who purchased more than 10 items in the last month."
sql_query = sql_generator(
prompt,
domain_context="Retail database with tables customers, orders, and order_items"
)
print(sql_query)
Base model
openai/gpt-oss-20b