Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
3c15fd19
Unverified
Commit
3c15fd19
authored
Dec 04, 2023
by
Sanchit Gandhi
Committed by
GitHub
Dec 04, 2023
Browse files
[Seamless v2] Add FE to auto mapping (#27829)
parent
1d63b0ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
src/transformers/models/auto/feature_extraction_auto.py
src/transformers/models/auto/feature_extraction_auto.py
+1
-0
tests/pipelines/test_pipelines_automatic_speech_recognition.py
.../pipelines/test_pipelines_automatic_speech_recognition.py
+17
-0
No files found.
src/transformers/models/auto/feature_extraction_auto.py
View file @
3c15fd19
...
...
@@ -78,6 +78,7 @@ FEATURE_EXTRACTOR_MAPPING_NAMES = OrderedDict(
(
"regnet"
,
"ConvNextFeatureExtractor"
),
(
"resnet"
,
"ConvNextFeatureExtractor"
),
(
"seamless_m4t"
,
"SeamlessM4TFeatureExtractor"
),
(
"seamless_m4t_v2"
,
"SeamlessM4TFeatureExtractor"
),
(
"segformer"
,
"SegformerFeatureExtractor"
),
(
"sew"
,
"Wav2Vec2FeatureExtractor"
),
(
"sew-d"
,
"Wav2Vec2FeatureExtractor"
),
...
...
tests/pipelines/test_pipelines_automatic_speech_recognition.py
View file @
3c15fd19
...
...
@@ -1115,6 +1115,23 @@ class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase):
assert
result
==
EXPECTED_RESULT
@
require_torch
@
slow
def
test_seamless_v2
(
self
):
pipe
=
pipeline
(
"automatic-speech-recognition"
,
model
=
"facebook/seamless-m4t-v2-large"
,
device
=
"cuda:0"
,
)
dataset
=
load_dataset
(
"hf-internal-testing/librispeech_asr_dummy"
,
"clean"
,
split
=
"validation"
)
sample
=
dataset
[
0
][
"audio"
]
result
=
pipe
(
sample
,
generate_kwargs
=
{
"tgt_lang"
:
"eng"
})
EXPECTED_RESULT
=
"mister quilter is the apostle of the middle classes and we are glad to welcome his gospel"
assert
result
[
"text"
]
==
EXPECTED_RESULT
@
require_torch
@
slow
def
test_chunking_and_timestamps
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment