-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
[Wav2Vec2] Rename model's feature extractor to feature encoder #14959
[Wav2Vec2] Rename model's feature extractor to feature encoder #14959
Conversation
…into correct_wav2vec2_feature_extractor_naming
...formers/models/unispeech_sat/convert_unispeech_sat_original_pytorch_checkpoint_to_pytorch.py
Outdated
Show resolved
Hide resolved
…into correct_wav2vec2_feature_extractor_naming
…ithub.com/patrickvonplaten/transformers into correct_wav2vec2_feature_extractor_naming
d530b58
to
5050232
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for doing the switch.
The PR is slightly breaking without a typealias from the old ModelTypeFeatureExtractor
to the new ModelTypeFeatureEncoder
class, but this is tiny and for an internal class of the modeling file, so I think this is acceptable for recent models (I wouldn't say the same thing for Bert for instance!)
"Please use the equivalent `freeze_feature_encoder` method instead.", | ||
FutureWarning, | ||
) | ||
self.hubert.feature_extractor._freeze_parameters() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good practice is to call the method that will replace it, so if you change code there for some reason, the code is automatically up to date.
Putting it just here once, but it's valid for all other models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for doing the switch.
The PR is slightly breaking without a typealias from the old
ModelTypeFeatureExtractor
to the newModelTypeFeatureEncoder
class, but this is tiny and for an internal class of the modeling file, so I think this is acceptable for recent models (I wouldn't say the same thing for Bert for instance!)
Yeah good point - will actually leave an alias
…into correct_wav2vec2_feature_extractor_naming
…ngface#14959) * rename classes * clean up more namings * remove bogus file * Apply suggestions from code review * Apply suggestions from code review * replace more names * more regex replace * make style * correct * correct more * make style * finish * correct more in wav2vec2 * make style * improve freeze_extractor * add aliases * add tf aliases
What does this PR do?
In this PR all
<SpeechModel>FeatureExtractor
are renamed to<SpeechModel>FeatureEncoder
and--freeze_feature_extractor
is renamed to--freeze_feature_encoder
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.