fix: Handle check_model_inputs removal in transformers 5.2.0#1369
Open
oliverholworthy wants to merge 3 commits intomainfrom
Open
fix: Handle check_model_inputs removal in transformers 5.2.0#1369oliverholworthy wants to merge 3 commits intomainfrom
oliverholworthy wants to merge 3 commits intomainfrom
Conversation
Signed-off-by: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com>
Signed-off-by: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com>
Signed-off-by: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com>
960cec6 to
7df5cd8
Compare
Contributor
Author
|
/ok to test 7df5cd8 |
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 ?
Fix
get_check_model_inputs_decorator()to handle transformers >= 5.2.0 wherecheck_model_inputswas removed and split intomerge_with_config_defaultsandcapture_outputs, and fix thenull_decoratorfallback that was broken by@contextmanager.Changelog
@contextmanagerfromnull_decorator— it turned the function into aContextDecoratorwhose__call__(self, func)signature collided with model forward kwargs likeinput_ids, causingTypeErrorat runtime.get_check_model_inputs_decorator()for transformers >= 5.2.0 that composesmerge_with_config_defaultsandcapture_outputsinto a single decorator.null_decoratorworks in both@decoratorand@decorator()forms.Before your PR is "Ready for review"
Pre checks:
Additional Information
Affects all three models using
get_check_model_inputs_decorator(): biencoder, llama, and qwen2. No model file changes needed, they already call the shared helper and will pick up the fix automatically.