Benjamin Bossan commited on
Commit
5c028cc
1 Parent(s): b38dea1

Make gradio auto display status of jobs

Browse files

No longer requires user to click a button to see job status.

Files changed (1) hide show
  1. demo.py +2 -3
demo.py CHANGED
@@ -36,15 +36,13 @@ def get_demo():
36
  btn_submit = gr.Button("Submit")
37
 
38
  # check job status
39
- status = gr.Label("Status: ")
40
- btn_status = gr.Button("Check Status")
41
 
42
  # display output
43
  btn_output = gr.Button("Show results")
44
  output = gr.Markdown()
45
 
46
  btn_submit.click(submit, inputs=inputs)
47
- btn_status.click(check_status, outputs=[status])
48
  btn_output.click(get_results, outputs=[output])
49
 
50
  return demo
@@ -52,4 +50,5 @@ def get_demo():
52
 
53
  if __name__ == "__main__":
54
  demo = get_demo()
 
55
  demo.launch()
 
36
  btn_submit = gr.Button("Submit")
37
 
38
  # check job status
39
+ gr.HTML(value=check_status, label="Status", every=3)
 
40
 
41
  # display output
42
  btn_output = gr.Button("Show results")
43
  output = gr.Markdown()
44
 
45
  btn_submit.click(submit, inputs=inputs)
 
46
  btn_output.click(get_results, outputs=[output])
47
 
48
  return demo
 
50
 
51
  if __name__ == "__main__":
52
  demo = get_demo()
53
+ demo.queue()
54
  demo.launch()