Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -538,18 +538,19 @@ if __name__ == "__main__":
|
|
538 |
time.sleep(10)
|
539 |
exit_status = 0
|
540 |
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
|
|
|
538 |
time.sleep(10)
|
539 |
exit_status = 0
|
540 |
|
541 |
+
try:
|
542 |
+
demo = build_demo(args.embed)
|
543 |
+
demo.launch(
|
544 |
+
server_name=args.host,
|
545 |
+
server_port=args.port,
|
546 |
+
share=args.share,
|
547 |
+
debug=True,
|
548 |
+
max_threads=10
|
549 |
+
)
|
550 |
+
except Exception as e:
|
551 |
+
print(e)
|
552 |
+
exit_status = 1
|
553 |
+
finally:
|
554 |
+
worker_proc.kill()
|
555 |
+
controller_proc.kill()
|
556 |
+
sys.exit(exit_status)
|