Sulitha commited on
Commit
1482db0
·
1 Parent(s): f5ec16f

Skip launch on Spaces; pin gradio_client<0.19

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +1 -0
app.py CHANGED
@@ -234,6 +234,6 @@ def build_ui() -> gr.Blocks:
234
 
235
  demo = build_ui()
236
 
237
- if __name__ == "__main__":
238
- # Works locally and on Hugging Face Spaces
239
  demo.launch()
 
234
 
235
  demo = build_ui()
236
 
237
+ # On Hugging Face Spaces, the runtime serves the app; avoid calling launch().
238
+ if __name__ == "__main__" and os.getenv("SPACE_ID") is None:
239
  demo.launch()
requirements.txt CHANGED
@@ -3,3 +3,4 @@ soundfile
3
  scipy
4
  huggingface_hub<0.25
5
  pymongo
 
 
3
  scipy
4
  huggingface_hub<0.25
5
  pymongo
6
+ gradio_client<0.19