Skip to content

Commit

Permalink
bugfix annoy_search
Browse files Browse the repository at this point in the history
  • Loading branch information
c7nw3r committed Aug 30, 2023
1 parent 90c56d8 commit 59e4437
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion localsearch/searcher/annoy_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def _rebuild(self):
folder = self.config.raw_data_dir if self.config.raw_data_dir else self.path.replace(".ann", "")
for path in os.listdir(folder):
if path.endswith(".json"):
idx = int(path.replace(".json", ""))
idx = path.replace(".json", "")
idx = read_json(f"{folder}/id_str/{idx}.json")["id"]
try:
vector = self.index.get_item_vector(idx)
new_index.add_item(idx, vector)
Expand Down

0 comments on commit 59e4437

Please sign in to comment.