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

Implement served_model_name to customize model id when use local mode… #749

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

dionren
Copy link
Contributor

@dionren dionren commented Jul 26, 2024

Motivation

Like vllm, user can load local model with model's id same as huggingface like: mistralai/Mistral-Large-Instruct-2407

Modification

Add an optional arg: served_model_name, change API: /v1/models

Checklist

  1. Ensure pre-commit pre-commit run --all-files or other linting tools are used to fix potential lint issues.
  2. Confirm that modifications are covered by complete unit tests. If not, please add more unit tests for correctness.
  3. Modify documentation as needed, such as docstrings or example tutorials.

Copy link
Member

@Ying1123 Ying1123 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I left a few comments.

if not self.served_model_name:
self.served_model_name = self.model_path
elif isinstance(self.served_model_name, list):
self.served_model_name = self.served_model_name[0]
Copy link
Member

Choose a reason for hiding this comment

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

If served_model_name is given in a wrong format (not a list), self.served_model_name will be None. This could trigger errors in other parts of the changes. Could you check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll check it.

@@ -18,6 +18,7 @@ class ServerArgs:
context_length: Optional[int] = None
quantization: Optional[str] = None
chat_template: Optional[str] = None
served_model_name: Optional[Union[str, List[str]]] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

@Ying1123 Ying1123 force-pushed the served_model_name branch from d360a4e to 64f300c Compare August 2, 2024 00:07
@Ying1123 Ying1123 merged commit 4013a4e into sgl-project:main Aug 2, 2024
1 of 2 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