madankn79's picture
Initial Commit
df7a119
raw
history blame contribute delete
528 Bytes
import gradio as gr
from prompt_generator import generate_prompt
from gpt4o_infer import call_gpt4o
def nlp_to_sql(nl_query, schema_text):
prompt = generate_prompt(nl_query, schema_text)
sql = call_gpt4o(prompt)
return sql
iface = gr.Interface(
fn=nlp_to_sql,
inputs=[gr.Textbox(label="Natural Language Query"), gr.Textbox(label="Schema in Natural Format")],
outputs="text",
title="NLP to SQL with GPT-4o",
description="Enter your natural language query and schema to get SQL"
)
iface.launch()