Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -659,24 +659,13 @@ if __name__ == "__main__":
|
|
| 659 |
login(token=api_key)
|
| 660 |
logger.info("Logged in to Hugging Face Hub")
|
| 661 |
|
| 662 |
-
# Launch Gradio app in a subprocess to avoid CUDA initialization in the main process
|
| 663 |
-
from torch.multiprocessing import Process
|
| 664 |
-
|
| 665 |
-
def launch_demo():
|
| 666 |
-
try:
|
| 667 |
-
demo = build_demo(embed_mode=args.embed, cur_dir='./', concurrency_count=args.concurrency_count)
|
| 668 |
-
demo.queue(
|
| 669 |
-
status_update_rate=10,
|
| 670 |
-
api_open=False
|
| 671 |
-
).launch(
|
| 672 |
-
server_name=args.host,
|
| 673 |
-
server_port=args.port,
|
| 674 |
-
share=args.share
|
| 675 |
-
)
|
| 676 |
-
except Exception as e:
|
| 677 |
-
logger.error(f"Error launching demo: {e}")
|
| 678 |
-
sys.exit(1)
|
| 679 |
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 659 |
login(token=api_key)
|
| 660 |
logger.info("Logged in to Hugging Face Hub")
|
| 661 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 662 |
|
| 663 |
+
demo = build_demo(embed_mode=args.embed, cur_dir='./', concurrency_count=args.concurrency_count)
|
| 664 |
+
demo.queue(
|
| 665 |
+
status_update_rate=10,
|
| 666 |
+
api_open=False
|
| 667 |
+
).launch(
|
| 668 |
+
server_name=args.host,
|
| 669 |
+
server_port=args.port,
|
| 670 |
+
share=args.share
|
| 671 |
+
)
|