Skip to content

Commit

Permalink
set default value of quantized_fetch_limit to 100 in case of ivfflat,…
Browse files Browse the repository at this point in the history
… because ef_search is not a param of ivfflat.
  • Loading branch information
Sheharyar570 authored and alwayslove2013 committed Nov 6, 2024
1 parent 06ab705 commit 43d098a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions vectordb_bench/backend/clients/pgvector/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
from vectordb_bench.backend.clients import DB



def set_default_quantized_fetch_limit(ctx, param, value):
if ctx.params.get("reranking") and value is None:
# ef_search is the default value for quantized_fetch_limit as it's bound by ef_search.
return ctx.params["ef_search"]
# 100 (arbitrary) is default value for quantized_fetch_limit for IVFFlat.
default_value = ctx.params["ef_search"] if ctx.command.name == "pgvectorhnsw" else 100
return default_value
return value

class PgVectorTypedDict(CommonTypedDict):
Expand Down
2 changes: 1 addition & 1 deletion vectordb_bench/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ class HNSWBaseRequiredTypedDict(TypedDict):

class HNSWFlavor1(HNSWBaseTypedDict):
ef_search: Annotated[
Optional[int], click.option("--ef-search", type=int, help="hnsw ef-search")
Optional[int], click.option("--ef-search", type=int, help="hnsw ef-search", is_eager=True)
]


Expand Down

0 comments on commit 43d098a

Please sign in to comment.