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

Incorrect type hint of "exponential_decay_length_penalty" in function "generate" #19368

Closed
pohunghuang-nctu opened this issue Oct 6, 2022 · 0 comments · Fixed by #19376
Closed

Comments

@pohunghuang-nctu
Copy link

pohunghuang-nctu commented Oct 6, 2022

Hi,
Please check below line,

exponential_decay_length_penalty: Optional[Tuple[Union[int, float]]] = None,

According to doc string, "exponential_decay_length_penalty (tuple(int, float), optional, defaults to model.config.exponential_decay_length_penalty):" (https://github.com/huggingface/transformers/blob/main/src/transformers/generation_utils.py#L1114)

the correct type hint should be "Optional[Tuple[int, float]]", the number of tuple elements should be 2, and must be "int" in position 0, and "float" in position 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant