Dharini Baskaran commited on
Commit
c9e469a
·
1 Parent(s): c2ff59c

button fix

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -117,10 +117,23 @@ with gr.Blocks() as demo:
117
  error_output = gr.Textbox(label="Error Message", visible=False)
118
 
119
  # Logic binding
 
 
 
 
 
 
120
  run_button.click(
 
 
 
 
121
  predict,
122
  inputs=[uploaded_file],
123
  outputs=[output_image, output_json, error_output, download_button, uploaded_image_display]
 
 
 
 
124
  )
125
-
126
  demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
 
117
  error_output = gr.Textbox(label="Error Message", visible=False)
118
 
119
  # Logic binding
120
+ # run_button.click(
121
+ # predict,
122
+ # inputs=[uploaded_file],
123
+ # outputs=[output_image, output_json, error_output, download_button, uploaded_image_display]
124
+ # )
125
+
126
  run_button.click(
127
+ lambda x: (x, gr.update(interactive=False)),
128
+ inputs=[uploaded_file],
129
+ outputs=[uploaded_file, run_button],
130
+ ).then(
131
  predict,
132
  inputs=[uploaded_file],
133
  outputs=[output_image, output_json, error_output, download_button, uploaded_image_display]
134
+ ).then(
135
+ lambda: gr.update(interactive=True),
136
+ None,
137
+ [run_button],
138
  )
 
139
  demo.launch(server_name="0.0.0.0", server_port=7860, share=True)