Hugging Face generators: set a default for max_new_tokens
#7365
Labels
2.x
Related to Haystack v2.0
Contributions wanted!
Looking for external contributions
good first issue
Good for newcomers
We have 4 Hugging Face Generators: HFLocalGenerator, HFTGIGenerator and the corresponding chat ones.
max_new_tokens
can be set at initialization inside thegeneration_kwargs
dict (or passed duringrun
).If not set, the Hugging Face default for
max_length
(= input prompt +max_new_tokens
) is 20, which leads almost always to truncated responses.Only in
HuggingFaceLocalChatGenerator
, we set the default to 512, which can be a good default.For consistency, we should also update the other Hugging Face Generators to provide the same default.
The text was updated successfully, but these errors were encountered: