fix: use absolute path for passages_file to prevent FileNotFoundError
When embedding server is launched as a subprocess, it may run in a different working directory. Using absolute paths ensures the server can always find the metadata file regardless of where it's launched from.
This commit is contained in:
@@ -112,8 +112,9 @@ class BaseSearcher(LeannBackendSearcherInterface, ABC):
|
||||
passages_source_file = (
|
||||
self.index_dir / f"{self.index_path.name}.meta.json"
|
||||
)
|
||||
# Convert to absolute path to ensure server can find it
|
||||
zmq_port = self._ensure_server_running(
|
||||
str(passages_source_file), zmq_port
|
||||
str(passages_source_file.resolve()), zmq_port
|
||||
)
|
||||
|
||||
return self._compute_embedding_via_server([query], zmq_port)[
|
||||
|
||||
Reference in New Issue
Block a user