adorkin commited on
Commit
4bfcca9
1 Parent(s): 46d9ba6

Organize the examples

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -61,20 +61,16 @@ with gr.Blocks() as demo:
61
  query_input = gr.Textbox(label="Sisestage teie otsingupäring")
62
  search_button = gr.Button("Otsi")
63
 
64
- with gr.Row():
65
- example_buttons = [gr.Button(example) for example in examples]
 
 
 
66
 
67
  results_output = gr.Dataframe(label="Otsingutulemused")
68
 
69
  search_button.click(search_query, inputs=query_input, outputs=results_output)
70
 
71
- for button in example_buttons:
72
- button.click(
73
- handle_example,
74
- inputs=gr.State(button.value),
75
- outputs=[query_input, results_output],
76
- )
77
-
78
 
79
  if __name__ == "__main__":
80
  demo.launch()
 
61
  query_input = gr.Textbox(label="Sisestage teie otsingupäring")
62
  search_button = gr.Button("Otsi")
63
 
64
+ gr.Examples(
65
+ examples=examples,
66
+ inputs=query_input,
67
+ label="Otsi päringunäiteid"
68
+ )
69
 
70
  results_output = gr.Dataframe(label="Otsingutulemused")
71
 
72
  search_button.click(search_query, inputs=query_input, outputs=results_output)
73
 
 
 
 
 
 
 
 
74
 
75
  if __name__ == "__main__":
76
  demo.launch()