Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions vectordb_bench/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@

def click_get_defaults_from_file(ctx, param, value): # noqa: ANN001, ARG001
if value:
input_file = value if Path.exists(value) else Path.join(config.CONFIG_LOCAL_DIR, value)
path = Path(value)
input_file = path if path.exists() else Path(config.CONFIG_LOCAL_DIR, path)
try:
with Path.open(input_file) as f:
with input_file.open() as f:
_config: dict[str, dict[str, Any]] = load(f.read(), Loader=Loader) # noqa: S506
ctx.default_map = _config.get(ctx.command.name, {})
except Exception as e:
Expand Down