Skip to content
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

Update processor mapping for hub snippets #27477

Merged

Conversation

amyeroberts
Copy link
Collaborator

What does this PR do?

Updates the processor mapping so that AutoImageProcessor is selected for vision models rather than the deprecated AutoFeatureExtractor. This should resolve auto-generated snippets on the hub that still show using old classes.

elif t in transformers_module.models.auto.image_processing_auto.IMAGE_PROCESSOR_MAPPING_NAMES:
processors[t] = "AutoImageProcessor"
elif t in transformers_module.models.auto.feature_extraction_auto.FEATURE_EXTRACTOR_MAPPING_NAMES:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the check for image processors before feature extractors - as old vision models still have their feature extractors in the FEATURE_EXTRACTOR_MAPPING_NAMES map

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 13, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@osanseviero osanseviero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@amyeroberts amyeroberts merged commit 303c1d6 into huggingface:main Nov 14, 2023
8 checks passed
@amyeroberts amyeroberts deleted the image-processor-update-metadata branch November 14, 2023 20:05
Saibo-creator pushed a commit to epfl-dlab/transformers-GCD-PR that referenced this pull request Nov 15, 2023
wgifford pushed a commit to namctin/transformers that referenced this pull request Nov 17, 2023
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants