Oluwaferanmi commited on
Commit
e75ba0c
·
1 Parent(s): dac20be

Re-upload valid PDFs with Git LFS

Browse files
Files changed (1) hide show
  1. orchestrator.py +7 -4
orchestrator.py CHANGED
@@ -41,10 +41,13 @@ VECTOR_STORE_DIR = os.getenv('VECTOR_STORE_DIR', '/tmp/vector_store')
41
  # Allow disabling RAG entirely for resource-constrained environments
42
  DISABLE_RAG = os.getenv('DISABLE_RAG', 'false').lower() in ('true', '1', 'yes')
43
 
44
- # Set cache directories for model loading (must match Dockerfile)
45
- os.environ.setdefault('TRANSFORMERS_CACHE', '/app/.cache/huggingface')
46
- os.environ.setdefault('HF_HOME', '/app/.cache/huggingface')
47
- os.environ.setdefault('SENTENCE_TRANSFORMERS_HOME', '/app/.cache/sentence-transformers')
 
 
 
48
 
49
  # Pre-download embedding model to cache
50
  def _ensure_embedding_model_cached(model_name: str) -> bool:
 
41
  # Allow disabling RAG entirely for resource-constrained environments
42
  DISABLE_RAG = os.getenv('DISABLE_RAG', 'false').lower() in ('true', '1', 'yes')
43
 
44
+
45
+ import os
46
+ os.environ["TRANSFORMERS_CACHE"] = "/tmp/huggingface_cache"
47
+ os.environ["SENTENCE_TRANSFORMERS_HOME"] = "/tmp/huggingface_cache"
48
+ os.environ["HF_HOME"] = "/tmp/huggingface_cache"
49
+ os.makedirs("/tmp/huggingface_cache", exist_ok=True)
50
+
51
 
52
  # Pre-download embedding model to cache
53
  def _ensure_embedding_model_cached(model_name: str) -> bool: