From bfe777412703129baccf221b4dbca7989315a0cc Mon Sep 17 00:00:00 2001 From: Dipika Sikka Date: Tue, 13 Feb 2024 09:42:43 -0500 Subject: [PATCH] fix if/else conditions with new ux flow (#1599) (#1601) --- src/deepsparse/server/cli.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/deepsparse/server/cli.py b/src/deepsparse/server/cli.py index 6d3952c5f5..d402f616fd 100644 --- a/src/deepsparse/server/cli.py +++ b/src/deepsparse/server/cli.py @@ -225,14 +225,11 @@ def main( if ctx.invoked_subcommand is not None: return - if task is None and config_file is None: - raise ValueError("Must specify either --task or --config_file. Found neither") - if config_file is not None: server = _fetch_server(integration=integration, config=config_file) server.start_server(host, port, log_level, hot_reload_config=hot_reload_config) - if task is not None: + elif task is not None: cfg = ServerConfig( num_cores=num_cores, num_workers=num_workers, @@ -258,6 +255,8 @@ def main( server.start_server( host, port, log_level, hot_reload_config=hot_reload_config ) + else: + raise ValueError("Must specify either --task or --config_file. Found neither") def _fetch_server(integration: str, config: Union[ServerConfig, str]):