Skip to content

Commit 9a7a37f

Browse files
committed
Simplify CLI launch arg conversion to LaunchOptions and ignore mypy check for the conversion
1 parent d2c64da commit 9a7a37f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

vec_inf/cli/_cli.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,18 @@ def launch(
146146
"""
147147
try:
148148
# Convert cli_kwargs to LaunchOptions
149-
kwargs = {k: v for k, v in cli_kwargs.items() if k != "json_mode"}
150-
launch_options = LaunchOptions(**kwargs)
149+
json_mode = cli_kwargs["json_mode"]
150+
del cli_kwargs["json_mode"]
151+
152+
launch_options = LaunchOptions(**cli_kwargs) # type: ignore
151153

152154
# Start the client and launch model inference server
153155
client = VecInfClient()
154156
launch_response = client.launch_model(model_name, launch_options)
155157

156158
# Display launch information
157159
launch_formatter = LaunchResponseFormatter(model_name, launch_response.config)
158-
if cli_kwargs.get("json_mode"):
160+
if json_mode:
159161
click.echo(launch_response.config)
160162
else:
161163
launch_info_table = launch_formatter.format_table_output()

0 commit comments

Comments
 (0)