-
Notifications
You must be signed in to change notification settings - Fork 243
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
Support min_new_tokens
generation config in pytorch engine
#1096
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AllentDan Fixed, eos would be ignored before reaching |
@lvhan028 is this OK? |
@irexyc what are the behavior of transformers and turbomind if |
set score of eos token to -inf when generated token length < min_new_tokens |
@AllentDan @irexyc I think PyTorch engine did the right thing. When |
Is it possible that stop_words got banned, but other possible new tokens are used when n>1? |
|
from lmdeploy import pipeline, GenerationConfig, TurbomindEngineConfig, PytorchEngineConfig
# test torch min new tokens
pipe = pipeline('/workspace/models-140/InternLM/internlm2-chat-7b/',
backend_config=PytorchEngineConfig())
response = pipe('hi', gen_config=GenerationConfig(
min_new_tokens=100
))
print(response) The generated response is:
I think |
@lvhan028 gen_config conversion does not include |
min_new_tokens
generation config in pytorch engine
tested on
chat
andbenchmark_pytorch_throughput