mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-02-01 19:32:55 -05:00
fix(cli): support loading model-id from local path
SDK should already support loading from local-path, but on CLI there was a bug with start where it sets the choice for model-id to only pretrained set of model-id Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
@@ -188,13 +188,13 @@ output_option = click.option(
|
||||
)
|
||||
|
||||
|
||||
def model_id_option(factory: t.Any, model_env: ModelEnv | None = None, click_type: click.ParamType | None = None):
|
||||
def model_id_option(factory: t.Any, model_env: ModelEnv | None = None):
|
||||
envvar = None
|
||||
if model_env is not None:
|
||||
envvar = model_env.model_id
|
||||
return factory.option(
|
||||
"--model-id",
|
||||
type=click_type if click_type else click.STRING,
|
||||
type=click.STRING,
|
||||
default=None,
|
||||
help="Optional model_id name or path for (fine-tune) weight.",
|
||||
envvar=envvar,
|
||||
@@ -584,7 +584,7 @@ Available model_id(s): {llm_config['model_ids']} [default: {llm_config['default_
|
||||
help="Server timeout in seconds",
|
||||
)
|
||||
@workers_per_resource_option(cog.optgroup)
|
||||
@model_id_option(cog.optgroup, model_env=env, click_type=click.Choice(llm_config["model_ids"]))
|
||||
@model_id_option(cog.optgroup, model_env=env)
|
||||
@cog.optgroup.option(
|
||||
"--fast",
|
||||
is_flag=True,
|
||||
|
||||
Reference in New Issue
Block a user