Spaces:
Sleeping
Sleeping
Timo
commited on
Commit
·
8b2e8bb
1
Parent(s):
a8ab236
Fixed env variables
Browse files- src/streamlit_app.py +7 -3
src/streamlit_app.py
CHANGED
|
@@ -15,9 +15,13 @@ for Hugging Face Spaces deployment.
|
|
| 15 |
from __future__ import annotations
|
| 16 |
import os, pathlib
|
| 17 |
# Writable locations --------------------------------------------------
|
| 18 |
-
os.environ
|
| 19 |
-
os.environ
|
| 20 |
-
os.environ
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
# --------------------------------------------------------------------
|
| 22 |
|
| 23 |
# create the dirs once
|
|
|
|
| 15 |
from __future__ import annotations
|
| 16 |
import os, pathlib
|
| 17 |
# Writable locations --------------------------------------------------
|
| 18 |
+
os.environ["HOME"] = "/tmp" # force, not setdefault
|
| 19 |
+
os.environ["XDG_CONFIG_HOME"] = "/tmp"
|
| 20 |
+
os.environ["STREAMLIT_CONFIG_DIR"] = "/tmp/.streamlit"
|
| 21 |
+
os.environ["STREAMLIT_CACHE_DIR"] = "/tmp/.st-cache"
|
| 22 |
+
os.environ["STREAMLIT_BROWSER_GATHERUSAGESTATS"] = "false"
|
| 23 |
+
for d in ("/tmp/.streamlit", "/tmp/.st-cache"):
|
| 24 |
+
pathlib.Path(d).mkdir(parents=True, exist_ok=True)
|
| 25 |
# --------------------------------------------------------------------
|
| 26 |
|
| 27 |
# create the dirs once
|