davidberenstein1957 HF staff commited on
Commit
e30a182
1 Parent(s): b92493b

feat: small ux updates

Browse files
Files changed (1) hide show
  1. app.py +17 -13
app.py CHANGED
@@ -88,22 +88,26 @@ with gr.Blocks() as demo:
88
  search_type="dataset",
89
  sumbit_on_select=True,
90
  )
91
-
 
 
 
 
 
 
 
 
 
 
 
 
92
  btn = gr.Button("Show Dataset")
 
 
93
  with gr.Row():
94
  search_out = gr.HTML(label="Search Results")
95
  with gr.Row():
96
  features = gr.Code(label="Features", language="json", visible=False)
97
- with gr.Row():
98
- query = gr.Textbox(
99
- label="Natural Language Query",
100
- placeholder="Enter a natural language query to generate SQL",
101
- )
102
- with gr.Row():
103
- sql_out = gr.Code(label="SQL Query", interactive=True, language="sql", lines=1)
104
- with gr.Row():
105
- btn2 = gr.Button("Query Dataset")
106
-
107
  gr.on(
108
  [btn.click, search_in.submit],
109
  fn=get_iframe,
@@ -114,8 +118,8 @@ with gr.Blocks() as demo:
114
  inputs=[search_in],
115
  outputs=[features],
116
  )
117
-
118
- btn2.click(
119
  fn=query_dataset,
120
  inputs=[search_in, features, query],
121
  outputs=[sql_out, search_out],
 
88
  search_type="dataset",
89
  sumbit_on_select=True,
90
  )
91
+ query = gr.Textbox(
92
+ label="Natural Language Query",
93
+ placeholder="Enter a natural language query to generate SQL",
94
+ )
95
+ sql_out = gr.Code(
96
+ label="SQL Query",
97
+ interactive=True,
98
+ language="sql",
99
+ lines=1,
100
+ visible=False,
101
+ )
102
+ with gr.Row():
103
+ with gr.Column():
104
  btn = gr.Button("Show Dataset")
105
+ with gr.Column():
106
+ btn2 = gr.Button("Query Dataset")
107
  with gr.Row():
108
  search_out = gr.HTML(label="Search Results")
109
  with gr.Row():
110
  features = gr.Code(label="Features", language="json", visible=False)
 
 
 
 
 
 
 
 
 
 
111
  gr.on(
112
  [btn.click, search_in.submit],
113
  fn=get_iframe,
 
118
  inputs=[search_in],
119
  outputs=[features],
120
  )
121
+ gr.on(
122
+ [btn2.click, query.submit],
123
  fn=query_dataset,
124
  inputs=[search_in, features, query],
125
  outputs=[sql_out, search_out],