Skip to content

Commit

Permalink
bug(faiss): mismatch in types (stanfordnlp#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
lawliet19189 authored Apr 23, 2023
1 parent 45ee111 commit 387dfb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dsp/utils/ann_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _get_ivf_index(
encode_residuals: bool
) -> Index:
# according to the FAISS doc, this should be OK
n_list = 4 * (n_objects ** 0.5)
n_list = int(4 * (n_objects ** 0.5))

if in_list_dist_type.lower() == 'ip':
quannizer = faiss.IndexFlatIP(emb_dim)
Expand All @@ -73,7 +73,7 @@ def _get_ivf_index(
n_list,
faiss.ScalarQuantizer.QT_fp16, # TODO: should be optional?
centroid_metric,
encode_residuals=encode_residuals
encode_residuals
)
return index

Expand Down

0 comments on commit 387dfb0

Please sign in to comment.