asoria HF staff commited on
Commit
8f57a99
β€’
1 Parent(s): a13202f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -18
app.py CHANGED
@@ -101,29 +101,22 @@ def text2sql(dataset_name, query_input):
101
 
102
 
103
  with gr.Blocks() as demo:
104
- with gr.Row():
105
- with gr.Column(scale=1, min_width=600):
106
- gr.Markdown("# πŸ’« Generate SQL queries based on a given text for your Hugging Face Dataset πŸ’«")
107
- with gr.Row():
108
- with gr.Column(scale=1, min_width=600):
109
- dataset_name = gr.Textbox("jamescalam/world-cities-geo", label="Dataset Name")
110
- query_input = gr.Textbox("Cities from Albania country", label="Ask something about your data")
111
- examples = [
112
  ["Cities from Albania country"],
113
  ["The continent with the most number of countries"],
114
  ["Cities that start with 'A'"],
115
  ["Cities by region"],
116
  ]
117
- with gr.Column(scale=1, min_width=600):
118
- gr.Examples(examples=examples, inputs=[query_input],outputs=[])
119
- btn = gr.Button("Generate SQL")
120
- with gr.Row():
121
- with gr.Accordion("Open for More!", open=False):
122
  #with gr.Column(scale=1, min_width=600):
123
- schema_output = gr.Textbox(label="Parquet Schema as CREATE DDL", interactive= False)
124
- prompt_output = gr.Textbox(label="Generated prompt", interactive= False)
125
- with gr.Column(scale=1, min_width=600):
126
- query_output = gr.Textbox(label="Output SQL", interactive= False)
127
- df = gr.DataFrame(datatype="markdown")
128
  btn.click(text2sql, inputs=[dataset_name, query_input], outputs=[schema_output, prompt_output, query_output,df])
129
  demo.launch(debug=True)
 
101
 
102
 
103
  with gr.Blocks() as demo:
104
+ gr.Markdown("# πŸ’« Generate SQL queries based on a given text for your Hugging Face Dataset πŸ’«")
105
+ dataset_name = gr.Textbox("jamescalam/world-cities-geo", label="Dataset Name")
106
+ query_input = gr.Textbox("Cities from Albania country", label="Ask something about your data")
107
+ examples = [
 
 
 
 
108
  ["Cities from Albania country"],
109
  ["The continent with the most number of countries"],
110
  ["Cities that start with 'A'"],
111
  ["Cities by region"],
112
  ]
113
+ gr.Examples(examples=examples, inputs=[query_input],outputs=[])
114
+ btn = gr.Button("Generate SQL")
115
+ query_output = gr.Textbox(label="Output SQL", interactive= False)
116
+ df = gr.DataFrame(datatype="markdown")
117
+ with gr.Accordion("Open for prompt details", open=False):
118
  #with gr.Column(scale=1, min_width=600):
119
+ schema_output = gr.Textbox(label="Parquet Schema as CREATE DDL", interactive= False)
120
+ prompt_output = gr.Textbox(label="Generated prompt", interactive= False)
 
 
 
121
  btn.click(text2sql, inputs=[dataset_name, query_input], outputs=[schema_output, prompt_output, query_output,df])
122
  demo.launch(debug=True)