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

"add support for vllm api stop parameter" #3527

Merged
merged 6 commits into from
May 6, 2024
Merged

"add support for vllm api stop parameter" #3527

merged 6 commits into from
May 6, 2024

Conversation

zhaonx
Copy link
Contributor

@zhaonx zhaonx commented Apr 30, 2024

What does this PR do?

Fixes #3114

Before submitting

@hiyouga hiyouga added the pending This problem is yet to be addressed label May 1, 2024
@hiyouga hiyouga self-requested a review May 6, 2024 16:13
Copy link
Owner

@hiyouga hiyouga 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 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(
Copy link
Owner

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

@@ -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"]
Copy link
Owner

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

@hiyouga
Copy link
Owner

hiyouga commented May 6, 2024

Some necessary changes have been made and this pr can be merged

@hiyouga hiyouga merged commit bcf7ec5 into hiyouga:main May 6, 2024
1 check passed
@hiyouga hiyouga added solved This problem has been already solved and removed pending This problem is yet to be addressed labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support "stop" in api chat/completions
2 participants