vaishu2002 commited on
Commit
93c90cc
·
verified ·
1 Parent(s): b9bf2a2

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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
- # Force Streamlit to use a writable directory
10
- os.environ["STREAMLIT_HOME"] = "/home/user/app/.streamlit"
11
- os.environ["STREAMLIT_CACHE_DIR"] = "/home/user/app/.streamlit/cache"
12
 
13
- os.makedirs("/home/user/app/.streamlit/cache", exist_ok=True)
 
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):