Skip to content

Commit

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

* use require_torch_gpu

* enable on XPU
  • Loading branch information
faaany authored and damithsenanayake committed Mar 7, 2024
1 parent 5780709 commit b754bb2
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 b754bb2

Please sign in to comment.