Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -4
src/streamlit_app.py
CHANGED
|
@@ -6,11 +6,12 @@ from langchain_google_genai import ChatGoogleGenerativeAI
|
|
| 6 |
from langchain.chains import LLMChain
|
| 7 |
import os
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
os.environ["STREAMLIT_HOME"] = "/
|
| 11 |
-
os.environ["STREAMLIT_CACHE_DIR"] = "/
|
| 12 |
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
def extract_text_from_docx(uploaded_file):
|
|
|
|
| 6 |
from langchain.chains import LLMChain
|
| 7 |
import os
|
| 8 |
|
| 9 |
+
# Use /tmp (the only guaranteed writable location on Hugging Face)
|
| 10 |
+
os.environ["STREAMLIT_HOME"] = "/tmp/.streamlit"
|
| 11 |
+
os.environ["STREAMLIT_CACHE_DIR"] = "/tmp/.streamlit/cache"
|
| 12 |
|
| 13 |
+
# Make sure the directories exist
|
| 14 |
+
os.makedirs("/tmp/.streamlit/cache", exist_ok=True)
|
| 15 |
|
| 16 |
|
| 17 |
def extract_text_from_docx(uploaded_file):
|