Skip to content

Commit

Permalink
Update search_docs_by_embedding.py
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorrr authored Oct 28, 2024
1 parent 7892cd7 commit edc471d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ def search_docs_by_embedding(
distance = cos_dist(query, embedding),
distance <= {radius}
:limit {k*(3 if mmr_strength else 1)} # Get more candidates for diversity
:create _search_result {{
doc_id,
index,
Expand Down Expand Up @@ -244,7 +246,7 @@ def search_docs_by_embedding(
# Sort the results by distance to find the closest matches
:sort -mmr_score
:limit {k}
:limit {k*(3 if mmr_strength else 1)}, # Get more candidates for diversity
:create _interim {{
owner_type,
Expand Down

0 comments on commit edc471d

Please sign in to comment.