TF: properly handle kwargs in encoder_decoder architectures#16465
Merged
gante merged 2 commits intohuggingface:mainfrom Mar 29, 2022
Merged
TF: properly handle kwargs in encoder_decoder architectures#16465gante merged 2 commits intohuggingface:mainfrom
gante merged 2 commits intohuggingface:mainfrom
Conversation
gante
commented
Mar 28, 2022
Comment on lines
575
to
577
| # Add arguments to encoder from `kwargs_encoder` | ||
| for k, v in kwargs_encoder.items(): | ||
| encoder_processing_inputs[k] = v |
Contributor
Author
There was a problem hiding this comment.
You can see here that all contents in kwargs_encoder are dumped into encoder_processing_inputs, so they were effectively being passed twice.
input_processing expects kwargs_call to be empty, except under very special circumstances (when using deprecated arguments)
|
The documentation is not available anymore as the PR was closed or merged. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Fixes #16400
Our
input_processingfunction is very strict and raises an exception if unexpected kwargs are passed. In the issue linked above, it was found that an exception was being raised and, upon further inspection, we can see that some arguments were being passed in the wrong place.There were no tests for it (i.e. no
encoder_decodercalls withkwargs), so it slipped under the cracks. This PR also adds tests for it. The updated tests were all failing before the corresponding fix.