billyaungmyint commited on
Commit
36b57c8
·
verified ·
1 Parent(s): dfc6e4e

Sync from GitHub via hub-sync

Browse files
Files changed (2) hide show
  1. VERSION +1 -1
  2. main.py +5 -1
VERSION CHANGED
@@ -1 +1 @@
1
- a2a87491c9589738010def70103c7e43a0fe584d
 
1
+ ba0f6e79436de596d18bfca048d749658bad26c4
main.py CHANGED
@@ -60,4 +60,8 @@ if __name__ == "__main__":
60
  # server_name="0.0.0.0" is required inside HF Space containers.
61
  # root_path ensures Gradio resolves JS/CSS assets correctly when running
62
  # behind a reverse proxy or custom domain.
63
- demo.launch(server_name="0.0.0.0", root_path=os.getenv("GRADIO_ROOT_PATH", ""))
 
 
 
 
 
60
  # server_name="0.0.0.0" is required inside HF Space containers.
61
  # root_path ensures Gradio resolves JS/CSS assets correctly when running
62
  # behind a reverse proxy or custom domain.
63
+ # Strip any trailing slash from GRADIO_ROOT_PATH; an incorrect value (e.g.
64
+ # the old .hf.space URL) after a custom-domain DNS change causes Gradio's
65
+ # frontend to fetch /info from the wrong origin → "Could not get API info".
66
+ _root_path = os.getenv("GRADIO_ROOT_PATH", "").rstrip("/")
67
+ demo.launch(server_name="0.0.0.0", root_path=_root_path)