Suchinthana commited on
Commit
f219d44
·
1 Parent(s): a1a380b

Example Selector added

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -226,11 +226,20 @@ def handle_query(query):
226
 
227
  return map_image, empty_map_image, satellite_image, mask_image, response
228
 
 
 
 
 
 
 
 
229
 
230
  # Gradio interface
231
  with gr.Blocks() as demo:
232
  with gr.Row():
233
- query_input = gr.Textbox(label="Enter Query")
 
 
234
  submit_btn = gr.Button("Submit")
235
  with gr.Row():
236
  map_output = gr.Image(label="Map Visualization")
 
226
 
227
  return map_image, empty_map_image, satellite_image, mask_image, response
228
 
229
+ def update_query(selected_query):
230
+ return selected_query
231
+
232
+ query_options = [
233
+ "“US $ 10.5 Million has been allocated to recommence the construction of Kurinchakerny Bridge facilitating the transport and business needs of approximately one hundred thousand residents in the Divisional Secretariat Division of Kinniya in Trincomalee District,” the ministry said in a statement.",
234
+ "Due to considerable rainfall in the up- and mid- stream areas of Kala Oya, the Rajanganaya reservoir is now spilling at a rate of 17,000 cubic feet per second, the department said."
235
+ ]
236
 
237
  # Gradio interface
238
  with gr.Blocks() as demo:
239
  with gr.Row():
240
+ selected_query = gr.Dropdown(label="Select Query", choices=query_options, value=query_options[-1])
241
+ query_input = gr.Textbox(label="Enter Query", value=query_options[-1])
242
+ selected_query.change(update_query, inputs=selected_query, outputs=query_input)
243
  submit_btn = gr.Button("Submit")
244
  with gr.Row():
245
  map_output = gr.Image(label="Map Visualization")