Remove explicit launch() — let HF SDK serve the demo
Browse files
app.py
CHANGED
|
@@ -449,7 +449,15 @@ with gr.Blocks(title="Bangla Book Recommender") as demo:
|
|
| 449 |
)
|
| 450 |
|
| 451 |
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 449 |
)
|
| 450 |
|
| 451 |
|
| 452 |
+
# ─────────────────────────────────────────────────────────────────────────────
|
| 453 |
+
# Note: We deliberately do NOT call demo.launch() here.
|
| 454 |
+
#
|
| 455 |
+
# On Hugging Face Spaces with Gradio 6.x, the platform's runtime spawns the
|
| 456 |
+
# server itself by importing this module and serving the `demo` object.
|
| 457 |
+
# Calling .launch() ourselves triggers a localhost-reachability check that
|
| 458 |
+
# fails inside the Space's container, raising:
|
| 459 |
+
# "When localhost is not accessible, a shareable link must be created..."
|
| 460 |
+
#
|
| 461 |
+
# For local development, run: `gradio app.py` (which calls launch() for you)
|
| 462 |
+
# or add `demo.launch()` back temporarily.
|
| 463 |
+
# ─────────────────────────────────────────────────────────────────────────────
|