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

check-in ModelConfig #907

Merged
merged 4 commits into from
Jan 4, 2024
Merged

check-in ModelConfig #907

merged 4 commits into from
Jan 4, 2024

Conversation

AllentDan
Copy link
Collaborator

No description provided.

@lvhan028
Copy link
Collaborator

lvhan028 commented Jan 3, 2024

How ModelConfig can help improve the user experience? Could you please provide a piece of pseudocode?

@AllentDan
Copy link
Collaborator Author

AllentDan commented Jan 3, 2024

How ModelConfig can help improve the user experience? Could you please provide a piece of pseudocode?

from lmdeploy import pipeline, GenerationConfig​, ModelConfig
from lmdeploy.turbomind import EngineConfigmodel_config = ModelConfig(meta_instruction='[fake meta_instructin]')​
pipe = lmdeploy.pipeline('internlm/internlm-chat-7b', backend_config=EngineConfig(), model_config = model_config)​
gen_config = GenerationConfig(max_new_tokens=100, top_p=0.8, top_k=40, temperature=0.8)​
response = pipe(prompts, gen_config, model_config)

lmdeploy/model.py Outdated Show resolved Hide resolved
capability: Optional[str] = None

@property
def model(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Setting builder method as property is a little bit strange.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is not supposed to be called frequently. And the build process is not computationally intensive.

@lvhan028
Copy link
Collaborator

lvhan028 commented Jan 4, 2024

May remove def main(...) in model.py

@lvhan028 lvhan028 merged commit 7e0e97c into InternLM:main Jan 4, 2024
3 of 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.

None yet

3 participants