Spaces:
Paused
Paused
Commit ·
ff97980
1
Parent(s): f03da5c
feat: Add --share option for instant public link generation
Browse files
main.py
CHANGED
|
@@ -243,7 +243,12 @@ app = gr.mount_gradio_app(app, demo, path="/gradio")
|
|
| 243 |
|
| 244 |
|
| 245 |
if __name__ == "__main__":
|
|
|
|
| 246 |
port = int(os.getenv("PORT", "7860"))
|
| 247 |
host = os.getenv("HOST", "0.0.0.0")
|
| 248 |
-
|
| 249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
|
| 244 |
|
| 245 |
if __name__ == "__main__":
|
| 246 |
+
import sys
|
| 247 |
port = int(os.getenv("PORT", "7860"))
|
| 248 |
host = os.getenv("HOST", "0.0.0.0")
|
| 249 |
+
share = "--share" in sys.argv or os.getenv("SHARE", "false").lower() == "true"
|
| 250 |
+
print(f"[Space Startup] Starting VECTOR Command Center UI on http://{host}:{port} (share={share})")
|
| 251 |
+
if share:
|
| 252 |
+
demo.launch(server_name=host, server_port=port, share=True)
|
| 253 |
+
else:
|
| 254 |
+
uvicorn.run(app, host=host, port=port)
|