Align default pipeline generation parameters with python transformers#1633
Align default pipeline generation parameters with python transformers#1633sroussey wants to merge 1 commit intohuggingface:mainfrom
Conversation
…_new_tokens, num_beams, do_sample, and temperature in Automatic Speech Recognition, Document Question Answering, Text Generation, and Text2Text Generation pipelines.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
There are a couple of failing tests. But besides that, changing the default behaviour (especially for the |
|
Hmm, yeah I didn't think about the do_sample: true default. this could be a bit confusing. the max_new_tokens default I think it pretty safe, because the current approach (inherited from python version) is to use |
|
if anything, this should have been part of v4 😅 (and I forgot/delayed) many models these days have their own generation config (sometimes using do_sample: true), so the behaviour should only be considered "fully-specified" if the user is the one doing the property setting |
xenova
left a comment
There was a problem hiding this comment.
thanks for the PR! I think the main fix we need is max_new_tokens, and although do_sample and temperature are less important, we can still include them for consistency. Marking as v4.1 is okay, as this probably should have been done in v4.0
to better align with the python library (see PR)
maybe we should introduce _default_generation_config on the class itself and use when we construct the generation config to actually use.
|
merged via #1649 |
Enhance pipeline configurations by setting default parameters for max_new_tokens, num_beams, do_sample, and temperature in Automatic Speech Recognition, Document Question Answering, Text Generation, and Text2Text Generation pipelines.
Closes #1632