-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Custom 4D tensor caused shape mismatch error #35290
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
Comments
Hey! are you running the script with |
Can you explain why it does not support custom mask? Also, is there any better way to implementing packing, e.g. letting the mask to be |
Try to add a dimension with torch.unsqueeze() for broadcasting the expanded_attn_mask. |
Can I take this issue up? |
hey @ArthurZucker , i was having a look at this and i think i ended up resolving it , in the process , so i raised a PR regarding the same . would really appreciate if you could take a look at it and respond at the earliest . |
Sorry all for the delay! |
@sambhavnoobcoder will have a look but enabling custom mask for us should be as simple as skipping the attention mask creation, not inversion or etc! |
Hey, I am new to open source and I would like to work on this issue. Can I get this assigned to me? |
Using flash_attention and position_ids to achieve this. Closing. |
System Info
transformers
version: 4.46.3Who can help?
@ArthurZucker
Can you take a look at this? I want to pack the samples using the custom attention mask. However, when using a mask of shape [1, 1, seq_len, seq_len], it raises the following error
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Expected behavior
Run without error.
The text was updated successfully, but these errors were encountered: