fix: build with direct embedding

This commit is contained in:
Andy Lee
2025-07-17 21:49:36 -07:00
parent 1c5fec5565
commit 71c7de9c84
2 changed files with 26 additions and 6 deletions

View File

@@ -141,6 +141,14 @@ class HNSWSearcher(BaseSearcher):
raise RuntimeError("Index is pruned but recompute is disabled.")
self._index = faiss.read_index(str(index_file), faiss.IO_FLAG_MMAP, hnsw_config)
# Load label mapping
label_map_file = self.index_dir / "leann.labels.map"
if not label_map_file.exists():
raise FileNotFoundError(f"Label map file not found at {label_map_file}")
with open(label_map_file, "rb") as f:
self.label_map = pickle.load(f)
def search(
self,