Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ with gr.Blocks(theme="finlaymacklon/smooth_slate") as demo:
|
|
| 46 |
clear_btn.add([results_textbox, report_textbox])
|
| 47 |
|
| 48 |
def check_report(report):
|
| 49 |
-
if running:
|
| 50 |
results = report_interface.process_input(report)
|
| 51 |
if results == "quit":
|
| 52 |
quit_fn()
|
|
@@ -61,9 +61,9 @@ with gr.Blocks(theme="finlaymacklon/smooth_slate") as demo:
|
|
| 61 |
|
| 62 |
def quit_fn():
|
| 63 |
running.value = False
|
| 64 |
-
|
| 65 |
|
| 66 |
check_btn.click(fn=check_report, inputs=[report_textbox], outputs=[results_textbox])
|
| 67 |
-
quit_btn.click(fn=quit_fn)
|
| 68 |
|
| 69 |
demo.launch(auth=(user, passwd))
|
|
|
|
| 46 |
clear_btn.add([results_textbox, report_textbox])
|
| 47 |
|
| 48 |
def check_report(report):
|
| 49 |
+
if running.value is True:
|
| 50 |
results = report_interface.process_input(report)
|
| 51 |
if results == "quit":
|
| 52 |
quit_fn()
|
|
|
|
| 61 |
|
| 62 |
def quit_fn():
|
| 63 |
running.value = False
|
| 64 |
+
return "Model has been stopped."
|
| 65 |
|
| 66 |
check_btn.click(fn=check_report, inputs=[report_textbox], outputs=[results_textbox])
|
| 67 |
+
quit_btn.click(fn=quit_fn, outputs=[results_textbox])
|
| 68 |
|
| 69 |
demo.launch(auth=(user, passwd))
|