Rajan Sharma commited on
Commit
b1e4a49
·
verified ·
1 Parent(s): 289abbe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -285,7 +285,15 @@ with gr.Blocks(theme=theme, css=custom_css) as demo:
285
  )
286
 
287
  if __name__ == "__main__":
288
- demo.launch()
 
 
 
 
 
 
 
 
289
 
290
 
291
 
 
285
  )
286
 
287
  if __name__ == "__main__":
288
+ # Hugging Face Spaces expects the app to listen on $PORT and 0.0.0.0
289
+ port = int(os.environ.get("PORT", "7860"))
290
+ demo.launch(
291
+ server_name="0.0.0.0",
292
+ server_port=port,
293
+ show_api=False, # optional: less overhead
294
+ max_threads=8, # optional: avoid thread-starvation on tiny CPUs
295
+ )
296
+
297
 
298
 
299