Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,16 @@
|
|
| 1 |
# Streamlit App for Multimodal RAG System - Deployment Optimized
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
import streamlit as st
|
| 4 |
import os
|
|
|
|
| 1 |
# Streamlit App for Multimodal RAG System - Deployment Optimized
|
| 2 |
+
import os, pathlib
|
| 3 |
+
cache_root = pathlib.Path(os.getcwd())/".cache"
|
| 4 |
+
(cache_root/"huggingface").mkdir(parents=True, exist_ok=True)
|
| 5 |
+
(cache_root/"torch").mkdir(parents=True, exist_ok=True)
|
| 6 |
+
os.environ.setdefault("HF_HOME", str(cache_root/"huggingface"))
|
| 7 |
+
os.environ.setdefault("TRANSFORMERS_CACHE", str(cache_root/"huggingface"))
|
| 8 |
+
os.environ.setdefault("HUGGINGFACE_HUB_CACHE", str(cache_root/"huggingface"))
|
| 9 |
+
os.environ.setdefault("HF_DATASETS_CACHE", str(cache_root/"huggingface"))
|
| 10 |
+
os.environ.setdefault("SENTENCE_TRANSFORMERS_HOME", str(cache_root/"huggingface"))
|
| 11 |
+
os.environ.setdefault("XDG_CACHE_HOME", str(cache_root))
|
| 12 |
+
os.environ.setdefault("TORCH_HOME", str(cache_root/"torch"))
|
| 13 |
+
os.environ.setdefault("TOKENIZERS_PARALLELISM", "false")
|
| 14 |
|
| 15 |
import streamlit as st
|
| 16 |
import os
|