DevnilMaster1 commited on
Commit
1c70e81
·
verified ·
1 Parent(s): 6df7a78

Remove explicit launch() — let HF SDK serve the demo

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -449,7 +449,15 @@ with gr.Blocks(title="Bangla Book Recommender") as demo:
449
  )
450
 
451
 
452
- if __name__ == "__main__":
453
- # On Hugging Face Spaces, the SDK manages the launch — keep this minimal.
454
- # No theme, no extra params; HF injects what's needed.
455
- demo.launch()
 
 
 
 
 
 
 
 
 
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
+ # ─────────────────────────────────────────────────────────────────────────────