Spaces:
Running on Zero
Running on Zero
Fix Space launch: bind 0.0.0.0:7860
Browse files
app.py
CHANGED
|
@@ -557,11 +557,9 @@ def build() -> gr.Blocks:
|
|
| 557 |
if __name__ == "__main__":
|
| 558 |
app = build()
|
| 559 |
app.queue(default_concurrency_limit=1, max_size=20)
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
server_port=int(os.environ.get("PORT", "8080")),
|
| 567 |
-
)
|
|
|
|
| 557 |
if __name__ == "__main__":
|
| 558 |
app = build()
|
| 559 |
app.queue(default_concurrency_limit=1, max_size=20)
|
| 560 |
+
# On HF Spaces the server must bind 0.0.0.0:7860 (localhost is not reachable
|
| 561 |
+
# through the platform proxy).
|
| 562 |
+
app.launch(
|
| 563 |
+
server_name="0.0.0.0",
|
| 564 |
+
server_port=int(os.environ.get("PORT", "7860")),
|
| 565 |
+
)
|
|
|
|
|
|