Skip to content

fix(docs): drop --model-name from the lmdeploy chat examples - #5201

Open
VenishPaneliya wants to merge 1 commit into
InternLM:mainfrom
VenishPaneliya:docs-chat-model-name
Open

VenishPaneliya wants to merge 1 commit into
InternLM:mainfrom
VenishPaneliya:docs-chat-model-name

Conversation

@VenishPaneliya

Copy link
Copy Markdown

Motivation

docs/en/inference/load_hf.md is the "Load huggingface model directly" page, and
both of its usage blocks start with

lmdeploy chat $repo_id --model-name $model_name

--model-name is registered only on lmdeploy serve api_server
(ArgumentHelper.model_name is called at lmdeploy/cli/serve.py:104 and nowhere
else), and the CLI uses parser.parse_args(), so the documented command exits
immediately:

lmdeploy: error: unrecognized arguments: --model-name llama2-chat-70b

The option also means something different from what the page implies: on
api_server it is the served model's public name reported by /v1/models
(added in #1403), not a model-type selector. lmdeploy chat detects the chat
template from the model path and takes --chat-template as the override.

Modification

Dropped --model-name $model_name from the four lmdeploy chat invocations on
docs/en/inference/load_hf.md and its docs/zh_cn mirror. The
lmdeploy serve api_server ... --model-name ... lines on the same pages are
left as they are, since the option is valid there. The model_name= shell
variable is still used by those serve lines, so it stays.

Every other --model-name mention in docs/ is on serve api_server, so these
two pages were the only place the option was attached to chat.

BC-breaking (Optional)

No.

Checklist

  1. Documentation-only change; no lint-relevant code touched.
  2. No unit tests: the change removes an argument from a shell example. I checked
    it by rebuilding both subcommands' argparse option sets from
    lmdeploy/cli/{cli,serve,utils}.py and replaying all 8 lmdeploy ...
    invocations on the two pages — 4 failed before this change and 0 after, with
    the serve api_server --model-name lines parsing in both cases.

The --model-name option is registered only on `lmdeploy serve api_server`,
so `lmdeploy chat $repo_id --model-name $model_name` exits with
"error: unrecognized arguments: --model-name". The chat template is
detected from the model path, with --chat-template as the override.

The serve invocations on the same page are unchanged: --model-name is
valid there and sets the name reported by /v1/models.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant