Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from transformers import pipeline | |
| # Load pipeline for text2sql | |
| pipe = pipeline("text2text-generation", model="mrm8488/t5-base-finetuned-wikiSQL") | |
| def generate_sql(query): | |
| result = pipe(f"translate English to SQL: {query}") | |
| return result[0]['generated_text'] | |
| iface = gr.Interface( | |
| fn=generate_sql, | |
| inputs=gr.Textbox(lines=2, placeholder="Enter your natural language query..."), | |
| outputs="text", | |
| title="SQL Query Generator", | |
| description="Enter a natural language question and get a SQL query." | |
| ) | |
| iface.launch() | |