Skip to content

Commit

Permalink
fix if/else conditions with new ux flow (#1599) (#1601)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsikka authored Feb 13, 2024
1 parent a15543e commit bfe7774
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/deepsparse/server/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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]):
Expand Down

0 comments on commit bfe7774

Please sign in to comment.