Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/transformers/models/auto/feature_extraction_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
[
("beit", "BeitFeatureExtractor"),
("deit", "DeiTFeatureExtractor"),
("hubert", "Wav2Vec2FeatureExtractor"),
("speech_to_text", "Speech2TextFeatureExtractor"),
("vit", "ViTFeatureExtractor"),
("wav2vec2", "Wav2Vec2FeatureExtractor"),
Expand Down
2 changes: 2 additions & 0 deletions src/transformers/models/hubert/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@


_import_structure = {
".wav2vec2.feature_extraction_wav2vec2": ["Wav2Vec2FeatureExtractor"],
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO - this is ok. What do you think @sgugger ? In short we need to make HuBERT work with AutoFeatureExtractor and it uses the exact same feature extractor than Wav2Vec2. Either we import Wav2Vec2 here or we add a hack to how feature extractors are loaded in models/auto/modeling_auto_feature_extractor.py WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is less hacky than what we did with MT5. Works for me.

"configuration_hubert": ["HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "HubertConfig"],
}

Expand All @@ -43,6 +44,7 @@
]

if TYPE_CHECKING:
from ..wav2vec2.feature_extraction_wav2vec2 import Wav2Vec2FeatureExtractor
from .configuration_hubert import HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, HubertConfig

if is_torch_available():
Expand Down