davidfertube commited on
Commit
6327a52
·
1 Parent(s): 3f92c41

Fix: Add api_name to event handlers

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -306,16 +306,18 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Predictive Agent") as demo:
306
  predict_btn.click(
307
  fn=analyze_equipment,
308
  inputs=[health_index, vibration, heat_rate_delta, operating_hours, start_count],
309
- outputs=output
 
310
  )
311
 
312
  demo1_btn.click(fn=load_demo_1, outputs=[health_index, vibration, heat_rate_delta,
313
- operating_hours, start_count])
 
314
  demo2_btn.click(fn=load_demo_2, outputs=[health_index, vibration, heat_rate_delta,
315
- operating_hours, start_count])
 
316
 
317
- upload_btn.click(fn=analyze_csv, inputs=file_upload, outputs=output)
318
 
319
- if __name__ == "__main__":
320
- demo.queue()
321
- demo.launch()
 
306
  predict_btn.click(
307
  fn=analyze_equipment,
308
  inputs=[health_index, vibration, heat_rate_delta, operating_hours, start_count],
309
+ outputs=output,
310
+ api_name="predict"
311
  )
312
 
313
  demo1_btn.click(fn=load_demo_1, outputs=[health_index, vibration, heat_rate_delta,
314
+ operating_hours, start_count],
315
+ api_name="demo_healthy")
316
  demo2_btn.click(fn=load_demo_2, outputs=[health_index, vibration, heat_rate_delta,
317
+ operating_hours, start_count],
318
+ api_name="demo_degraded")
319
 
320
+ upload_btn.click(fn=analyze_csv, inputs=file_upload, outputs=output, api_name="analyze_csv")
321
 
322
+ demo.queue()
323
+ demo.launch()