MarianaCodebase commited on
Commit
04ece09
·
verified ·
1 Parent(s): 9f5c233

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -1,5 +1,16 @@
1
  """Lost Frequency Radio backend — gradio.Server + streaming /tune."""
2
 
 
 
 
 
 
 
 
 
 
 
 
3
  import queue
4
  import re
5
  import threading
@@ -378,4 +389,4 @@ def finale(code: str, language: str = "es", variant: float = 0) -> str:
378
 
379
 
380
  if __name__ == "__main__":
381
- app.launch(server_name="0.0.0.0", server_port=7860, show_error=True)
 
1
  """Lost Frequency Radio backend — gradio.Server + streaming /tune."""
2
 
3
+ import os
4
+
5
+ # This app serves its own hand-built index.html through a FastAPI route; there
6
+ # are no Gradio Blocks to server-side render. Gradio 6 turns SSR on by default,
7
+ # which spins up a Node proxy (Node -> Python :7861) that immediately dies on
8
+ # HF Spaces ("Stopping Node.js server..."), taking the whole app down with it.
9
+ # Force SSR off before Gradio is imported. This has to be the env var, not just
10
+ # launch(ssr_mode=False): HF's gradio runner imports this module ("demo not
11
+ # found in __main__") instead of executing the __main__ block at the bottom.
12
+ os.environ.setdefault("GRADIO_SSR_MODE", "false")
13
+
14
  import queue
15
  import re
16
  import threading
 
389
 
390
 
391
  if __name__ == "__main__":
392
+ app.launch(server_name="0.0.0.0", server_port=7860, show_error=True, ssr_mode=False)