cli: add --no-recompute and --no-recompute-embeddings flags; docs: clarify HNSW requires --no-compact when disabling recompute
This commit is contained in:
@@ -319,8 +319,8 @@ Details: see “Running Builds on SkyPilot (Optional)” below.
|
|||||||
If you need lower latency and have more storage/memory, disable recomputation. This stores full embeddings and avoids recomputing at search time.
|
If you need lower latency and have more storage/memory, disable recomputation. This stores full embeddings and avoids recomputing at search time.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build without recomputation
|
# Build without recomputation (HNSW requires non-compact in this mode)
|
||||||
leann build my-index --no-recompute
|
leann build my-index --no-recompute --no-compact
|
||||||
|
|
||||||
# Search without recomputation
|
# Search without recomputation
|
||||||
leann search my-index "your query" --no-recompute
|
leann search my-index "your query" --no-recompute
|
||||||
|
|||||||
@@ -117,7 +117,19 @@ Examples:
|
|||||||
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("--compact", action="store_true", default=True)
|
||||||
|
build_parser.add_argument(
|
||||||
|
"--no-compact",
|
||||||
|
dest="compact",
|
||||||
|
action="store_false",
|
||||||
|
help="Disable compact index storage (store full embeddings; higher storage)",
|
||||||
|
)
|
||||||
build_parser.add_argument("--recompute", action="store_true", default=True)
|
build_parser.add_argument("--recompute", action="store_true", default=True)
|
||||||
|
build_parser.add_argument(
|
||||||
|
"--no-recompute",
|
||||||
|
dest="recompute",
|
||||||
|
action="store_false",
|
||||||
|
help="Disable embedding recomputation (store full embeddings; lower query latency)",
|
||||||
|
)
|
||||||
build_parser.add_argument(
|
build_parser.add_argument(
|
||||||
"--file-types",
|
"--file-types",
|
||||||
type=str,
|
type=str,
|
||||||
@@ -138,6 +150,18 @@ Examples:
|
|||||||
default=True,
|
default=True,
|
||||||
help="Recompute embeddings (default: True)",
|
help="Recompute embeddings (default: True)",
|
||||||
)
|
)
|
||||||
|
search_parser.add_argument(
|
||||||
|
"--no-recompute-embeddings",
|
||||||
|
dest="recompute_embeddings",
|
||||||
|
action="store_false",
|
||||||
|
help="Disable embedding recomputation during search",
|
||||||
|
)
|
||||||
|
search_parser.add_argument(
|
||||||
|
"--no-recompute",
|
||||||
|
dest="recompute_embeddings",
|
||||||
|
action="store_false",
|
||||||
|
help="Alias for --no-recompute-embeddings",
|
||||||
|
)
|
||||||
search_parser.add_argument(
|
search_parser.add_argument(
|
||||||
"--pruning-strategy",
|
"--pruning-strategy",
|
||||||
choices=["global", "local", "proportional"],
|
choices=["global", "local", "proportional"],
|
||||||
@@ -166,6 +190,18 @@ Examples:
|
|||||||
default=True,
|
default=True,
|
||||||
help="Recompute embeddings (default: True)",
|
help="Recompute embeddings (default: True)",
|
||||||
)
|
)
|
||||||
|
ask_parser.add_argument(
|
||||||
|
"--no-recompute-embeddings",
|
||||||
|
dest="recompute_embeddings",
|
||||||
|
action="store_false",
|
||||||
|
help="Disable embedding recomputation during ask",
|
||||||
|
)
|
||||||
|
ask_parser.add_argument(
|
||||||
|
"--no-recompute",
|
||||||
|
dest="recompute_embeddings",
|
||||||
|
action="store_false",
|
||||||
|
help="Alias for --no-recompute-embeddings",
|
||||||
|
)
|
||||||
ask_parser.add_argument(
|
ask_parser.add_argument(
|
||||||
"--pruning-strategy",
|
"--pruning-strategy",
|
||||||
choices=["global", "local", "proportional"],
|
choices=["global", "local", "proportional"],
|
||||||
|
|||||||
Reference in New Issue
Block a user