-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
The attention mask is not set and cannot be inferred from input because pad token is same as eos token. As a consequence, you may observe unexpected behavior. Please pass your input's attention_mask
to obtain reliable results.
#33498
Comments
Related: openai/whisper#2335 |
@asmith26 thanks for the issue! I've reproduced it here, will open a PR to fix in a sec. |
I observed this when I was finetuning a LLM with ppo trainer. To resolve this warning I passed the attention mask as a named parameter to the generate function following this.
But then I observed an error which stated, "IndexError: too many indices for tensor of dimension 1" on the line of
I turned off the attention mask and using print statements before that line_e I inspected what is the ideal behavior of this line_e. The original warning was coming but i ignored it. I saw that position ids are being fed one by one. So to resolve this error I just unsqueezed the attention mask.
and it worked fine. |
Thanks for your help with this @Rocketknight1. Just thought I'd mention I still seem to be getting the same warning (I'm currently running Thanks again! |
@asmith26 I'm not getting that warning when I run the code sample above anymore. Did you change anything about it? |
Interesting, thanks for the info @Rocketknight1 I've determined that if I add a Happy to remove this argument for my need. Thanks again! :) |
That's still potentially an issue we should address, though! Even though you've found a fix, I'll reopen to make sure we don't lose track |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
System Info
transformers
version: 4.44.2Who can help?
speech models: @ylacombe, @eustlb
pipelines: @Rocketknight1
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Expected behavior
This does return the expected:
But it also prints the following, so would be nice to fix/suppress:
Thanks!
The text was updated successfully, but these errors were encountered: