aapot commited on
Commit
0df2f2d
1 Parent(s): 5bd6efa

Add queue handling

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -93,12 +93,14 @@ with gr.Blocks(title=demo_title) as demo:
93
  return {video_embedded2: embedded_value, output_label: None}
94
 
95
  run_btn.click(fn=get_video_similarity, inputs=inputs, outputs=outputs)
96
- clear_btn.click(lambda value_1, value_2, value_3: (
97
- None, None, None), inputs=inputs + outputs, outputs=inputs + outputs)
 
98
 
99
  input_text1.change(lambda input: inputs_change(
100
- input, 1), inputs=input_text1, outputs=[video_embedded1, output_label])
101
  input_text2.change(lambda input: inputs_change(
102
- input, 2), inputs=input_text2, outputs=[video_embedded2, output_label])
103
 
 
104
  demo.launch()
 
93
  return {video_embedded2: embedded_value, output_label: None}
94
 
95
  run_btn.click(fn=get_video_similarity, inputs=inputs, outputs=outputs)
96
+ # no need clear output label as it will get cleared anyway with inputs_change()
97
+ clear_btn.click(lambda value_1, value_2: (None, None),
98
+ inputs=inputs, outputs=inputs, queue=False)
99
 
100
  input_text1.change(lambda input: inputs_change(
101
+ input, 1), inputs=input_text1, outputs=[video_embedded1, output_label], queue=False)
102
  input_text2.change(lambda input: inputs_change(
103
+ input, 2), inputs=input_text2, outputs=[video_embedded2, output_label], queue=False)
104
 
105
+ demo.queue()
106
  demo.launch()