Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[server] Add model argument to server cli #1584

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Changes from 1 commit
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
33 changes: 5 additions & 28 deletions src/deepsparse/server/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,7 @@
),
)

MODEL_OPTION = click.option(
"--model_path",
type=str,
default="default",
help=(
"The path to a model.onnx file, a model folder containing the model.onnx "
"and supporting files, or a SparseZoo model stub. "
"If not specified, the default model for the task is used."
),
)
MODEL_OPTION = click.argument("model_path", type=str, default="default")

BATCH_OPTION = click.option(
"--batch_size",
Expand Down Expand Up @@ -216,6 +207,10 @@ def main(
...
```
"""
if integration == INTEGRATION_OPENAI:
if task is None or task != "text_generation":
task = "text_generation"

if ctx.invoked_subcommand is not None:
return

Expand Down Expand Up @@ -254,24 +249,6 @@ def main(
server.start_server(host, port, log_level, hot_reload_config=hot_reload_config)


@main.command(
context_settings=dict(
token_normalize_func=lambda x: x.replace("-", "_"), show_default=True
),
)
@click.argument("config-file", type=str)
@HOST_OPTION
@PORT_OPTION
@LOG_LEVEL_OPTION
@HOT_RELOAD_OPTION
def openai(
config_file: str, host: str, port: int, log_level: str, hot_reload_config: bool
):

server = OpenAIServer(server_config=config_file)
server.start_server(host, port, log_level, hot_reload_config=hot_reload_config)


@main.command(
context_settings=dict(
token_normalize_func=lambda x: x.replace("-", "_"), show_default=True
Expand Down
Loading