Skip to content

Commit

Permalink
Fix: Inferring OS-dependant file path in Python
Browse files Browse the repository at this point in the history
Closes #174
  • Loading branch information
ashvardanian committed Jul 31, 2023
1 parent a8f78e5 commit 7743709
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/usearch/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,19 +660,19 @@ def save(self, path: Optional[os.PathLike] = None):
path = path if path else self.path
if path is None:
raise Exception("Define `path` argument")
self._compiled.save(path)
self._compiled.save(os.fspath(path))

def load(self, path: Optional[os.PathLike] = None):
path = path if path else self.path
if path is None:
raise Exception("Define `path` argument")
self._compiled.load(path)
self._compiled.load(os.fspath(path))

def view(self, path: Optional[os.PathLike] = None):
path = path if path else self.path
if path is None:
raise Exception("Define `path` argument")
self._compiled.view(path)
self._compiled.view(os.fspath(path))

def clear(self):
"""Erases all the vectors from the index, preserving the space for future insertions."""
Expand Down

0 comments on commit 7743709

Please sign in to comment.