Spaces:
Sleeping
Sleeping
changing streamlite path
Browse files- src/streamlit_app.py +6 -6
src/streamlit_app.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
-
import os
|
| 2 |
|
| 3 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
os.environ["STREAMLIT_HOME"] = streamlit_home
|
| 8 |
-
os.makedirs(os.environ["STREAMLIT_HOME"], exist_ok=True)
|
| 9 |
-
|
| 10 |
-
print(f"STREAMLIT_HOME set to: {streamlit_home}")
|
| 11 |
|
| 12 |
import streamlit as st
|
| 13 |
import time
|
|
|
|
| 1 |
+
import os, socket
|
| 2 |
|
| 3 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 4 |
+
hostname = socket.gethostname()
|
| 5 |
|
| 6 |
+
if "hf" in hostname or "space" in hostname:
|
| 7 |
+
os.environ["STREAMLIT_HOME"] = "/tmp/streamlit"
|
| 8 |
+
os.makedirs(os.environ["STREAMLIT_HOME"], exist_ok=True)
|
| 9 |
|
| 10 |
+
print(f"BASE_DIR: {BASE_DIR}, HOSTNAME: {hostname}")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
import streamlit as st
|
| 13 |
import time
|