tarakjc2c commited on
Commit
48541bf
·
1 Parent(s): 019fa63

Create embeddings cache dir and remove share=True for HF Spaces

Browse files
Files changed (1) hide show
  1. app_retrieval_cached.py +6 -2
app_retrieval_cached.py CHANGED
@@ -21,6 +21,10 @@ from team.interfaces import Candidate
21
  CACHE_DIR = Path("cache")
22
  CACHE_DIR.mkdir(exist_ok=True)
23
 
 
 
 
 
24
  print("=" * 70)
25
  print(" Medical Document Retrieval System (CACHED VERSION)")
26
  print(" Using BM25 + Dense Embeddings + RRF Fusion")
@@ -391,8 +395,8 @@ with gr.Blocks(title="Medical Document Retrieval (Cached)") as demo:
391
 
392
  print("\nOpening web interface...")
393
  print(" Local access: http://127.0.0.1:7863")
394
- print(" Public link will be generated...")
395
  print("=" * 70)
396
 
397
  if __name__ == "__main__":
398
- demo.launch(server_name="127.0.0.1", server_port=7863, share=True)
 
 
21
  CACHE_DIR = Path("cache")
22
  CACHE_DIR.mkdir(exist_ok=True)
23
 
24
+ # Ensure embeddings cache directory exists (for Dense index)
25
+ EMBEDDINGS_CACHE_DIR = Path(".cache/embeddings")
26
+ EMBEDDINGS_CACHE_DIR.mkdir(parents=True, exist_ok=True)
27
+
28
  print("=" * 70)
29
  print(" Medical Document Retrieval System (CACHED VERSION)")
30
  print(" Using BM25 + Dense Embeddings + RRF Fusion")
 
395
 
396
  print("\nOpening web interface...")
397
  print(" Local access: http://127.0.0.1:7863")
 
398
  print("=" * 70)
399
 
400
  if __name__ == "__main__":
401
+ # Note: share=True only works locally, not on HuggingFace Spaces
402
+ demo.launch(server_name="127.0.0.1", server_port=7863)