rdz-falcon commited on
Commit
044cef5
·
verified ·
1 Parent(s): 1d15b56

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +12 -0
src/streamlit_app.py CHANGED
@@ -12,6 +12,18 @@ import streamlit as st
12
  import pandas as pd
13
  import rag # Import the rag module
14
  import os # Import os for file path handling
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
 
17
  st.set_page_config(layout="wide", page_title="Communication Board")
 
12
  import pandas as pd
13
  import rag # Import the rag module
14
  import os # Import os for file path handling
15
+ cache_dir_base = "/app/.cache_app"
16
+
17
+ # Create the base directory if it doesn't exist
18
+ os.makedirs(cache_dir_base, exist_ok=True)
19
+
20
+ # Set environment variables for Hugging Face libraries
21
+ os.environ['HF_HOME'] = os.path.join(cache_dir_base, 'huggingface_hub') # For hub downloads
22
+ os.environ['TRANSFORMERS_CACHE'] = os.path.join(cache_dir_base, 'transformers') # For transformers models
23
+ os.environ['SENTENCE_TRANSFORMERS_HOME'] = os.path.join(cache_dir_base, 'sentence_transformers') # For sentence-transformers
24
+
25
+ # Set environment variable for pip cache (optional but good practice)
26
+ os.environ['PIP_CACHE_DIR'] = os.path.join(cache_dir_base, 'pip')
27
 
28
 
29
  st.set_page_config(layout="wide", page_title="Communication Board")