[FeatureExtractorSavingUtils] Refactor PretrainedFeatureExtractor (#10594)

* save first version

* finish refactor

* finish refactor

* correct naming

* correct naming

* shorter names

* Update src/transformers/feature_extraction_common_utils.py

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>

* change name

* finish

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
This commit is contained in:
Patrick von Platen
2021-03-09 12:16:59 +03:00
committed by GitHub
parent b6a28e9ac9
commit 9a06b6b11b
10 changed files with 638 additions and 572 deletions

View File

@@ -23,7 +23,7 @@ import numpy as np
from transformers import WAV_2_VEC_2_PRETRAINED_MODEL_ARCHIVE_LIST, Wav2Vec2Config, Wav2Vec2FeatureExtractor
from transformers.testing_utils import slow
from .test_feature_extraction_common import FeatureExtractionMixin
from .test_sequence_feature_extraction_common import SequenceFeatureExtractionTestMixin
global_rng = random.Random()
@@ -94,7 +94,7 @@ class Wav2Vec2FeatureExtractionTester(unittest.TestCase):
return speech_inputs
class Wav2Vec2FeatureExtractionTest(FeatureExtractionMixin, unittest.TestCase):
class Wav2Vec2FeatureExtractionTest(SequenceFeatureExtractionTestMixin, unittest.TestCase):
feature_extraction_class = Wav2Vec2FeatureExtractor