-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Fix pad_token
check condition
#25685
Conversation
@@ -2503,7 +2503,7 @@ def _get_padding_truncation_strategies( | |||
max_length = self.model_max_length | |||
|
|||
# Test if we have a padding token | |||
if padding_strategy != PaddingStrategy.DO_NOT_PAD and (not self.pad_token or self.pad_token_id < 0): |
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.
This line exist for 3 years but we don't have problem. Guess it's because we never has pad_token=0
(not id)
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.
Or rather ('n', 'no', 'f', 'false', 'off', '0')
🤣
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!
@@ -2503,7 +2503,7 @@ def _get_padding_truncation_strategies( | |||
max_length = self.model_max_length | |||
|
|||
# Test if we have a padding token | |||
if padding_strategy != PaddingStrategy.DO_NOT_PAD and (not self.pad_token or self.pad_token_id < 0): |
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.
Or rather ('n', 'no', 'f', 'false', 'off', '0')
🤣
The documentation is not available anymore as the PR was closed or merged. |
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
What does this PR do?
Fix #25625