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

set served model name being repo_id from hub before it is downloaded #2494

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

lvhan028
Copy link
Collaborator

Previously, the served model name is the full path of the downloaded model, which is not user-friendly.

@@ -16,6 +16,12 @@ def run():
parser = CLI.parser
args = parser.parse_args()

if hasattr(args, 'model_name'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we modify codes inside? APIs may suffer the same problem.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pipeline api doesn't need model_name. model_name is only used by v1/models
If we launch api_server through python -m lmdeploy.serve.openai.api_server internlm/internlm2_5-1_8b-chat, the result of v1/models is what we expect "internlm/internlm2_5-1_8-chat".

But if we launch the server by lmdeploy serve api_server, v1/models returns the full local path of the model, because it always try to get_model if the args.model_path doesn't exist

if model_path is not None and not os.path.exists(args.model_path):
            args.model_path = get_model(args.model_path,
                                        download_dir=download_dir,
                                        revision=revision)
        model_path_or_server = getattr(args, 'model_path_or_server', None)

Copy link
Collaborator

@AllentDan AllentDan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@RunningLeon RunningLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lvhan028 lvhan028 merged commit 8173929 into InternLM:main Sep 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants