[Hubert] Fix Hubert processing auto #21299
Merged
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?
Currently on the
mainbranch, the scripts provided on the docstring ofHubertfails:With the PR #21225 all custom
xxxProcessorhave been removed in favor ofAutoProcessorin docstrings. SinceHubertwas not included inside the processor automapping the script above lead into a bug, since if the model is not present in the auto mapping dictionary, the script will try to load a tokenizer:transformers/src/transformers/models/auto/processing_auto.py
Line 275 in 255257f
Wav2vec2CTCTokenizerwas loaded instead ofWav2vec2Processorthat is supposed to be the target object to be loaded.This PR fixes this by adding
hubertinside the automapping class forAutoProcessorThis PR also fixes 2 failing doctests for
HubertModel, link to failing job: https://github.com/huggingface/transformers/actions/runs/4002271138/jobs/6869333719cc @sgugger @ydshieh