Remove static pretrained maps from the library's internals (#29112)
* [test_all] Remove static pretrained maps from the library's internals * Deprecate archive maps instead of removing them * Revert init changes * [test_all] Deprecate instead of removing * [test_all] PVT v2 support * [test_all] Tests should all pass * [test_all] Style * Address review comments * Update src/transformers/models/deprecated/_archive_maps.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update src/transformers/models/deprecated/_archive_maps.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * [test_all] trigger tests * [test_all] LLAVA * [test_all] Bad rebase --------- Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
This commit is contained in:
@@ -20,7 +20,7 @@ import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
from transformers import WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2Config, Wav2Vec2FeatureExtractor
|
||||
from transformers import Wav2Vec2Config, Wav2Vec2FeatureExtractor
|
||||
from transformers.testing_utils import require_torch, slow
|
||||
|
||||
from ...test_sequence_feature_extraction_common import SequenceFeatureExtractionTestMixin
|
||||
@@ -224,10 +224,10 @@ class Wav2Vec2FeatureExtractionTest(SequenceFeatureExtractionTestMixin, unittest
|
||||
# this test makes sure that models that are using
|
||||
# group norm don't have their feature extractor return the
|
||||
# attention_mask
|
||||
for model_id in WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST:
|
||||
config = Wav2Vec2Config.from_pretrained(model_id)
|
||||
feat_extract = Wav2Vec2FeatureExtractor.from_pretrained(model_id)
|
||||
model_id = "facebook/wav2vec2-base-960h"
|
||||
config = Wav2Vec2Config.from_pretrained(model_id)
|
||||
feat_extract = Wav2Vec2FeatureExtractor.from_pretrained(model_id)
|
||||
|
||||
# only "layer" feature extraction norm should make use of
|
||||
# attention_mask
|
||||
self.assertEqual(feat_extract.return_attention_mask, config.feat_extract_norm == "layer")
|
||||
# only "layer" feature extraction norm should make use of
|
||||
# attention_mask
|
||||
self.assertEqual(feat_extract.return_attention_mask, config.feat_extract_norm == "layer")
|
||||
|
||||
Reference in New Issue
Block a user