fix file path bug still compatiable bug in hnsw search

This commit is contained in:
yichuan520030910320
2025-07-03 02:02:42 +00:00
parent 44815ee7fd
commit a627abe794
4 changed files with 5 additions and 5 deletions

View File

@@ -151,7 +151,7 @@ class HNSWBackend(LeannBackendFactoryInterface):
@staticmethod
def searcher(index_path: str, **kwargs) -> LeannBackendSearcherInterface:
path = Path(index_path)
meta_path = path.parent / f"{path.stem}.hnsw.meta.json"
meta_path = path.parent / f"{path.name}.meta.json"
if not meta_path.exists():
raise FileNotFoundError(f"Leann metadata file not found at {meta_path}. Cannot infer vector dimension for searcher.")