Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
aade711d
Unverified
Commit
aade711d
authored
Mar 04, 2024
by
Fanli Lin
Committed by
GitHub
Mar 04, 2024
Browse files
[tests] enable automatic speech recognition pipeline tests on XPU (#29308)
* use require_torch_gpu * enable on XPU
parent
831bc25d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tests/pipelines/test_pipelines_automatic_speech_recognition.py
.../pipelines/test_pipelines_automatic_speech_recognition.py
+3
-3
No files found.
tests/pipelines/test_pipelines_automatic_speech_recognition.py
View file @
aade711d
...
...
@@ -1221,7 +1221,7 @@ class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase):
processor
=
AutoProcessor
.
from_pretrained
(
"openai/whisper-tiny.en"
)
model
=
WhisperForConditionalGeneration
.
from_pretrained
(
"openai/whisper-tiny.en"
)
model
=
model
.
to
(
"cuda"
)
model
=
model
.
to
(
torch_device
)
pipe
=
pipeline
(
"automatic-speech-recognition"
,
...
...
@@ -1229,7 +1229,7 @@ class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase):
tokenizer
=
processor
.
tokenizer
,
feature_extractor
=
processor
.
feature_extractor
,
max_new_tokens
=
128
,
device
=
"cuda:0"
,
device
=
torch_device
,
)
ds
=
load_dataset
(
"distil-whisper/meanwhile"
,
"default"
)[
"test"
]
...
...
@@ -1246,7 +1246,7 @@ class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase):
pipe
=
pipeline
(
"automatic-speech-recognition"
,
model
=
"facebook/seamless-m4t-v2-large"
,
device
=
"cuda:0"
,
device
=
torch_device
,
)
dataset
=
load_dataset
(
"hf-internal-testing/librispeech_asr_dummy"
,
"clean"
,
split
=
"validation"
)
...
...
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