Spaces:
Sleeping
Sleeping
vijesh418 commited on
Commit ·
adeb0c7
1
Parent(s): dd1f5f6
Bind to 0.0.0.0 on Spaces and disable SSR
Browse files
app.py
CHANGED
|
@@ -1039,10 +1039,13 @@ if __name__ == "__main__":
|
|
| 1039 |
get_text_pipe()
|
| 1040 |
except Exception as e:
|
| 1041 |
print("[MoodSyncAI] Warmup text failed:", e)
|
|
|
|
|
|
|
| 1042 |
demo.queue().launch(
|
| 1043 |
-
server_name="127.0.0.1",
|
| 1044 |
server_port=7860,
|
| 1045 |
-
inbrowser=
|
| 1046 |
show_error=True,
|
| 1047 |
show_api=False,
|
|
|
|
| 1048 |
)
|
|
|
|
| 1039 |
get_text_pipe()
|
| 1040 |
except Exception as e:
|
| 1041 |
print("[MoodSyncAI] Warmup text failed:", e)
|
| 1042 |
+
import os as _os
|
| 1043 |
+
_on_spaces = bool(_os.environ.get("SPACE_ID"))
|
| 1044 |
demo.queue().launch(
|
| 1045 |
+
server_name="0.0.0.0" if _on_spaces else "127.0.0.1",
|
| 1046 |
server_port=7860,
|
| 1047 |
+
inbrowser=not _on_spaces,
|
| 1048 |
show_error=True,
|
| 1049 |
show_api=False,
|
| 1050 |
+
ssr_mode=False,
|
| 1051 |
)
|