Skip to content

Commit

Permalink
[tests] enable automatic speech recognition pipeline tests on XPU (#2…
Browse files Browse the repository at this point in the history
…9308)

* use require_torch_gpu

* enable on XPU
  • Loading branch information
faaany authored and Ita Zaporozhets committed May 14, 2024
1 parent 288c335 commit a340b3f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1221,15 +1221,15 @@ def test_whisper_longform(self):

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",
model=model,
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"]
Expand All @@ -1246,7 +1246,7 @@ def test_seamless_v2(self):
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")
Expand Down

0 comments on commit a340b3f

Please sign in to comment.