blackboxanalytics commited on
Commit
418300b
·
1 Parent(s): f66f37b

Fix 'Try the demo' on the Space: allow serving the bundled clip

Browse files

On HF Spaces, Gradio 6 returns 403 for gradio_api/file=…/examples/
pushback_demo.mp3 unless its directory is in allowed_paths, so clicking
'Try the demo' failed to load the clip (and a downstream frontend error
blocked the fingerprint readout). Add the examples dir to launch(allowed_paths).

Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1090,5 +1090,9 @@ if __name__ == "__main__":
1090
  # queue: one heavy job at a time (single GPU), others wait rather than
1091
  # contend. show_error surfaces a real error in the UI instead of a silently
1092
  # stuck spinner — the failure mode we just chased on the deployed Space.
 
 
 
1093
  app.queue(default_concurrency_limit=1, max_size=10).launch(
1094
- theme=THEME, css=CSS, show_error=True)
 
 
1090
  # queue: one heavy job at a time (single GPU), others wait rather than
1091
  # contend. show_error surfaces a real error in the UI instead of a silently
1092
  # stuck spinner — the failure mode we just chased on the deployed Space.
1093
+ # allowed_paths: on HF Spaces, Gradio 6 refuses to serve the bundled demo
1094
+ # clip (gradio_api/file=…/examples/… → 403) unless its directory is
1095
+ # explicitly allowed, which broke the "Try the demo" button on the Space.
1096
  app.queue(default_concurrency_limit=1, max_size=10).launch(
1097
+ theme=THEME, css=CSS, show_error=True,
1098
+ allowed_paths=[os.path.join(os.path.dirname(__file__), "examples")])