Fix wrong variable in check_model_type isinstance check#46080
Merged
Rocketknight1 merged 1 commit intoMay 25, 2026
Merged
Conversation
Rocketknight1
approved these changes
May 20, 2026
Member
Rocketknight1
left a comment
There was a problem hiding this comment.
Yes, good job spotting it!
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Member
|
This will get merged whenever the CI decides to co-operate |
In Pipeline.check_model_type(), the inner loop over _model_mapping._extra_content uses 'model' as its iteration variable, but the isinstance check on line 1103 referenced 'model_name' from the outer loop. This caused incorrect tuple/non-tuple branching for dynamically registered models, potentially raising AttributeError. This bug was introduced in huggingface#24960 (2023-07-21). Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
9ee2bbb to
38c23db
Compare
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 a bug in
Pipeline.check_model_type()where the inner loop over_model_mapping._extra_content(line 1102) usesmodelas its iteration variable, but theisinstancecheck on line 1103 referencedmodel_namefrom the outer loop. This caused incorrect tuple/non-tuple branching for dynamically registered models (viaAutoModel.register()), potentially raisingAttributeError.This bug was introduced in #24960 (2023-07-21) and has been present for nearly 2 years.
Before submitting
check_model_type; the fix is a self-evident 1-word variable rename.Who can review?
@Rocketknight1 (pipelines)