Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,12 @@ print("--- Python script starting ---")
|
|
| 4 |
|
| 5 |
import streamlit as st
|
| 6 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
from dotenv import load_dotenv
|
| 8 |
from pinecone import Pinecone
|
| 9 |
|
|
|
|
| 4 |
|
| 5 |
import streamlit as st
|
| 6 |
import os
|
| 7 |
+
os.environ['HF_HOME'] = '/app/huggingface_cache' # For transformers and datasets
|
| 8 |
+
os.environ['TRANSFORMERS_CACHE'] = '/app/huggingface_cache/transformers'
|
| 9 |
+
os.environ['SENTENCE_TRANSFORMERS_HOME'] = '/app/huggingface_cache/sentence_transformers'
|
| 10 |
+
# Create the directory if it doesn't exist, with permissions
|
| 11 |
+
if not os.path.exists('/app/huggingface_cache'):
|
| 12 |
+
os.makedirs('/app/huggingface_cache', exist_ok=True)
|
| 13 |
from dotenv import load_dotenv
|
| 14 |
from pinecone import Pinecone
|
| 15 |
|