Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -196,15 +196,15 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue")) as demo:
|
|
196 |
fig, plot_error = generate_plot(query_text, result_df)
|
197 |
return sql_query, result_df, fig, plot_error if plot_error else ""
|
198 |
|
199 |
-
btn_example1.click(lambda: on_example_click("Show awards over 1M in CA"), outputs=[results_out,
|
200 |
-
btn_example2.click(lambda: on_example_click("List all contracts in New York"), outputs=[results_out,
|
201 |
-
btn_example3.click(lambda: on_example_click("Show top 5 departments by award amount"), outputs=[results_out,
|
202 |
-
btn_example4.click(lambda: on_example_click("SELECT * from contract_data LIMIT 10;"), outputs=[results_out,
|
203 |
|
204 |
query.submit(
|
205 |
fn=on_query_submit,
|
206 |
inputs=query,
|
207 |
-
outputs=[error_out, results_out
|
208 |
)
|
209 |
|
210 |
# =========================
|
|
|
196 |
fig, plot_error = generate_plot(query_text, result_df)
|
197 |
return sql_query, result_df, fig, plot_error if plot_error else ""
|
198 |
|
199 |
+
btn_example1.click(lambda: on_example_click("Show awards over 1M in CA"), outputs=[results_out, error_out])
|
200 |
+
btn_example2.click(lambda: on_example_click("List all contracts in New York"), outputs=[results_out, error_out])
|
201 |
+
btn_example3.click(lambda: on_example_click("Show top 5 departments by award amount"), outputs=[results_out, error_out])
|
202 |
+
btn_example4.click(lambda: on_example_click("SELECT * from contract_data LIMIT 10;"), outputs=[results_out, error_out])
|
203 |
|
204 |
query.submit(
|
205 |
fn=on_query_submit,
|
206 |
inputs=query,
|
207 |
+
outputs=[error_out, results_out]
|
208 |
)
|
209 |
|
210 |
# =========================
|