Skip to content

Commit

Permalink
Merge pull request #22 from stanford-oval/fix/19
Browse files Browse the repository at this point in the history
fix for #19
  • Loading branch information
george1459 authored May 7, 2024
2 parents ba7b3a7 + 249627c commit 45a652a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Package metadata
name = "suql"
version = "1.1.7a2"
version = "1.1.7a3"
description = "Structured and Unstructured Query Language (SUQL) Python API"
author = "Shicheng Liu"
author_email = "[email protected]"
Expand Down
2 changes: 2 additions & 0 deletions src/suql/faiss_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ def dot_product(self, id_list, query, top, individual_id_list=[]):
params=faiss.SearchParametersIVF(sel=sel),
)
else:
if top > self.embeddings.ntotal:
top = self.embeddings.ntotal
D, I = self.embeddings.search(
query_embedding, top, params=faiss.SearchParametersIVF(sel=sel)
)
Expand Down

0 comments on commit 45a652a

Please sign in to comment.