cli: use argparse.BooleanOptionalAction for paired flags (--recompute/--compact) across build/search/ask
This commit is contained in:
@@ -116,19 +116,17 @@ Examples:
|
|||||||
build_parser.add_argument("--graph-degree", type=int, default=32)
|
build_parser.add_argument("--graph-degree", type=int, default=32)
|
||||||
build_parser.add_argument("--complexity", type=int, default=64)
|
build_parser.add_argument("--complexity", type=int, default=64)
|
||||||
build_parser.add_argument("--num-threads", type=int, default=1)
|
build_parser.add_argument("--num-threads", type=int, default=1)
|
||||||
build_parser.add_argument("--compact", action="store_true", default=True)
|
|
||||||
build_parser.add_argument(
|
build_parser.add_argument(
|
||||||
"--no-compact",
|
"--compact",
|
||||||
dest="compact",
|
action=argparse.BooleanOptionalAction,
|
||||||
action="store_false",
|
default=True,
|
||||||
help="Disable compact index storage (store full embeddings; higher storage)",
|
help="Use compact index storage (default: enabled). Use --no-compact to disable and store full embeddings.",
|
||||||
)
|
)
|
||||||
build_parser.add_argument("--recompute", action="store_true", default=True)
|
|
||||||
build_parser.add_argument(
|
build_parser.add_argument(
|
||||||
"--no-recompute",
|
"--recompute",
|
||||||
dest="recompute",
|
action=argparse.BooleanOptionalAction,
|
||||||
action="store_false",
|
default=True,
|
||||||
help="Disable embedding recomputation (store full embeddings; lower query latency)",
|
help="Enable embedding recomputation (default: enabled). Use --no-recompute to store full embeddings and speed up queries.",
|
||||||
)
|
)
|
||||||
build_parser.add_argument(
|
build_parser.add_argument(
|
||||||
"--file-types",
|
"--file-types",
|
||||||
@@ -144,18 +142,12 @@ Examples:
|
|||||||
search_parser.add_argument("--complexity", type=int, default=64)
|
search_parser.add_argument("--complexity", type=int, default=64)
|
||||||
search_parser.add_argument("--beam-width", type=int, default=1)
|
search_parser.add_argument("--beam-width", type=int, default=1)
|
||||||
search_parser.add_argument("--prune-ratio", type=float, default=0.0)
|
search_parser.add_argument("--prune-ratio", type=float, default=0.0)
|
||||||
search_parser.add_argument(
|
|
||||||
"--no-recompute",
|
|
||||||
dest="recompute_embeddings",
|
|
||||||
action="store_false",
|
|
||||||
help="Disable embedding recomputation during search",
|
|
||||||
)
|
|
||||||
search_parser.add_argument(
|
search_parser.add_argument(
|
||||||
"--recompute",
|
"--recompute",
|
||||||
dest="recompute_embeddings",
|
dest="recompute_embeddings",
|
||||||
action="store_true",
|
action=argparse.BooleanOptionalAction,
|
||||||
default=True,
|
default=True,
|
||||||
help="Enable embedding recomputation during search (default)",
|
help="Enable/disable embedding recomputation during search (default: enabled)",
|
||||||
)
|
)
|
||||||
search_parser.add_argument(
|
search_parser.add_argument(
|
||||||
"--pruning-strategy",
|
"--pruning-strategy",
|
||||||
@@ -179,18 +171,12 @@ Examples:
|
|||||||
ask_parser.add_argument("--complexity", type=int, default=32)
|
ask_parser.add_argument("--complexity", type=int, default=32)
|
||||||
ask_parser.add_argument("--beam-width", type=int, default=1)
|
ask_parser.add_argument("--beam-width", type=int, default=1)
|
||||||
ask_parser.add_argument("--prune-ratio", type=float, default=0.0)
|
ask_parser.add_argument("--prune-ratio", type=float, default=0.0)
|
||||||
ask_parser.add_argument(
|
|
||||||
"--no-recompute",
|
|
||||||
dest="recompute_embeddings",
|
|
||||||
action="store_false",
|
|
||||||
help="Disable embedding recomputation during ask",
|
|
||||||
)
|
|
||||||
ask_parser.add_argument(
|
ask_parser.add_argument(
|
||||||
"--recompute",
|
"--recompute",
|
||||||
dest="recompute_embeddings",
|
dest="recompute_embeddings",
|
||||||
action="store_true",
|
action=argparse.BooleanOptionalAction,
|
||||||
default=True,
|
default=True,
|
||||||
help="Enable embedding recomputation during ask (default)",
|
help="Enable/disable embedding recomputation during ask (default: enabled)",
|
||||||
)
|
)
|
||||||
ask_parser.add_argument(
|
ask_parser.add_argument(
|
||||||
"--pruning-strategy",
|
"--pruning-strategy",
|
||||||
|
|||||||
Reference in New Issue
Block a user