-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
"add support for vllm api stop parameter" #3527
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.
Thanks for adding this feature, I think it needs some changes before merging. Besides, we should raise an error or warning when the user uses stop parameter in hf engine
@@ -46,7 +46,10 @@ class GeneratingArguments: | |||
default=1.0, | |||
metadata={"help": "Exponential penalty to the length that is used with beam-based generation."}, | |||
) | |||
|
|||
stop: Union[Optional[str], List[str]] = field( |
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.
The arguments in GeneratingArguments should also be contained in the https://huggingface.co/docs/transformers/v4.40.2/en/main_classes/text_generation#transformers.GenerationConfig, but it is not now, we will delete it
src/llmtuner/chat/vllm_engine.py
Outdated
@@ -105,6 +106,7 @@ async def _generate( | |||
top_k=top_k or generating_args["top_k"], | |||
num_return_sequences=num_return_sequences or 1, | |||
repetition_penalty=repetition_penalty or generating_args["repetition_penalty"], | |||
stop=stop or generating_args["stop"] |
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.
we don't need to insert it into generating_args
Some necessary changes have been made and this pr can be merged |
What does this PR do?
Fixes #3114
Before submitting