Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,13 @@
|
|
1 |
import os
|
2 |
|
3 |
-
#
|
4 |
os.environ["STREAMLIT_WATCHED_MODULES"] = ""
|
|
|
|
|
5 |
|
6 |
-
# Set
|
7 |
-
os.environ["TRANSFORMERS_CACHE"] = "
|
8 |
-
os.makedirs("./hf_cache", exist_ok=True)
|
9 |
|
10 |
-
# Set Streamlit-specific options to prevent permission errors
|
11 |
-
os.environ["STREAMLIT_HOME"] = os.getcwd()
|
12 |
-
os.environ["STREAMLIT_RUNTIME_METRICS_ENABLED"] = "false"
|
13 |
-
os.makedirs(".streamlit", exist_ok=True)
|
14 |
|
15 |
import streamlit as st
|
16 |
import torch
|
|
|
1 |
import os
|
2 |
|
3 |
+
# Prevent Streamlit from watching files or writing to restricted dirs
|
4 |
os.environ["STREAMLIT_WATCHED_MODULES"] = ""
|
5 |
+
os.environ["STREAMLIT_RUNTIME_METRICS_ENABLED"] = "false"
|
6 |
+
os.environ["STREAMLIT_HOME"] = os.getcwd()
|
7 |
|
8 |
+
# Set Hugging Face transformers cache to a safe, writable folder
|
9 |
+
os.environ["TRANSFORMERS_CACHE"] = "/tmp/hf_cache"
|
|
|
10 |
|
|
|
|
|
|
|
|
|
11 |
|
12 |
import streamlit as st
|
13 |
import torch
|