Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +9 -0
src/streamlit_app.py
CHANGED
|
@@ -2,6 +2,15 @@ import os
|
|
| 2 |
os.environ["HF_HOME"] = "/tmp/huggingface"
|
| 3 |
os.environ["TRANSFORMERS_CACHE"] = "/tmp/huggingface/transformers"
|
| 4 |
os.environ["HF_DATASETS_CACHE"] = "/tmp/huggingface/datasets"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
import time
|
| 7 |
from datetime import datetime
|
|
|
|
| 2 |
os.environ["HF_HOME"] = "/tmp/huggingface"
|
| 3 |
os.environ["TRANSFORMERS_CACHE"] = "/tmp/huggingface/transformers"
|
| 4 |
os.environ["HF_DATASETS_CACHE"] = "/tmp/huggingface/datasets"
|
| 5 |
+
import os
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
|
| 8 |
+
# --- Fix Streamlit permission issue ---
|
| 9 |
+
os.environ["STREAMLIT_CACHE_DIR"] = "/tmp/streamlit_cache"
|
| 10 |
+
os.environ["STREAMLIT_RUNTIME_DIR"] = "/tmp/streamlit_runtime"
|
| 11 |
+
os.environ["STREAMLIT_CONFIG_DIR"] = "/tmp/.streamlit"
|
| 12 |
+
Path("/tmp/.streamlit").mkdir(parents=True, exist_ok=True)
|
| 13 |
+
|
| 14 |
|
| 15 |
import time
|
| 16 |
from datetime import datetime
|