Skip to content

Commit

Permalink
Used range_search for supported indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pringled committed Nov 15, 2024
1 parent 2b9f234 commit ea25c54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vicinity/backends/faiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def threshold(self, vectors: npt.NDArray, threshold: float) -> list[npt.NDArray]
out.append(within_threshold_indices)
else:
# Fallback to search-based filtering for indexes that do not support range_search
distances, indices = self.index.search(vectors, 100) # Arbitrarily large `k` to capture potential matches
distances, indices = self.index.search(vectors, 100)

for dist, idx in zip(distances, indices):
# Convert distances for cosine if needed
Expand Down

0 comments on commit ea25c54

Please sign in to comment.