-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
Fixes #17128 . #17356
Merged
Merged
Fixes #17128 . #17356
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nitpick, but if the tokenizer already has
token_type_ids
inmodel_input_names
(for example BERT), thentoken_type_ids
will be here twice. Why is this line necessary compared to before?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.
There are two ways to pass arguments to the
_forward
function, and the autobatcher will act differently if it's a Tensor or a list. (lists are unbatched, just lists of lists) while tensors get batched (with padded value and direction).The problem occurs here becaus
token_type_ids
are used in thepostprocessing
(likep_mask
) so they need to be correctly passed as tensors. So the hintself.tokenizer.model_input_names
is not enough and this line ensures that the postprocessing will see a tensor aligned with the others.If
token_type_ids
is listed twice, then maybe we can just (lmodel_input_names = set(model_input_names)
? (Actually thefw_args
andothers
are already dictionnary so I think there's only 1 level of duplication.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.
Yes that's one solution! Anyway it's a nitpick given that it won't change much. We're using this list to check if the name of a variable is in it, so if it's in it twice, it'll result in the same!
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.
You're right!
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.
Hi both. I got notification that this issue has been marked as stale. If there's anything to do be done, please let me know. If you both require more time to reach a conclusion, that's fine by me.
Thanks,
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.
@LysandreJik are you ok with merging this ?