fix: Dockerfile + multi-path e5-base model lookup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-24 02:50:51 +10:00
co-authored by Claude Opus 4.6
parent 358733c382
commit 9eb94a0f6a
2 changed files with 13 additions and 4 deletions
+7 -1
View File
@@ -14,7 +14,13 @@ import numpy as np
INDEX_DIR = Path(__file__).parent / "index"
# Local model: multilingual-e5-base (free, 768 dim, 5/5 accuracy)
E5_MODEL_PATH = str(Path.home() / ".cache/huggingface/hub/models--intfloat--multilingual-e5-base/snapshots/main")
# Try multiple locations
_E5_PATHS = [
Path.home() / ".cache/huggingface/hub/models--intfloat--multilingual-e5-base/snapshots/main",
Path.home() / "e5-base-model",
Path("/app/e5-base-model"),
]
E5_MODEL_PATH = str(next((p for p in _E5_PATHS if p.exists()), _E5_PATHS[0]))
EMBEDDING_DIM = 768
_model_cache = None