Fix AutoImageProcessor.register and documentation in auto processing modules #41864
+26
−34
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?
This PR fixes several issues in the auto processing modules:
Fixes
AutoImageProcessor.registerbug: Removes incorrect validation logic that was copied from tokenizers. The validation checked forslow_image_processor_classattribute consistency, but fast image processors don't have this attribute (unlike fast tokenizers), causing theregistermethod to fail when registering custom image processors.Fixes documentation errors: Corrects copy-paste errors in docstrings where "tokenizer" was incorrectly used instead of the appropriate processor type (feature extractor, image processor, video processor).
Fixes typos: Corrects "fine" → "find" in comments across multiple auto modules.
Improves
AutoVideoProcessortrust handling: Adds proper upstream repository extraction fromvideo_processor_auto_mapwhen resolving trust_remote_code.Changes by file:
feature_extraction_auto.py: Fixed typo and corrected docstring to reference feature extractors instead of tokenizersimage_processing_auto.py: Removed incorrectslow_image_processor_classvalidation and fixed import in docstring exampleprocessing_auto.py: Fixed typo in commenttokenization_auto.py: Fixed typo in commentvideo_processing_auto.py: Fixed docstring reference and added upstream repo handling for trust_remote_codeBefore submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@ArthurZucker @Rocketknight1 (auto modules and processing)