[Whisper] Fix slow test (#28407)

* [Whisper] Fix slow test

* update

* update

* update

* update

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Patrick von Platen
2024-01-10 22:35:36 +01:00
committed by GitHub
parent 6c78bbcb83
commit cbbe30749b
6 changed files with 10 additions and 1 deletions

View File

@@ -1651,8 +1651,10 @@ class WhisperModelIntegrationTests(unittest.TestCase):
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large")
model.to(torch_device)
ds = load_dataset("common_voice", "ja", split="test", streaming=True)
token = os.getenv("HF_HUB_READ_TOKEN", True)
ds = load_dataset("mozilla-foundation/common_voice_6_1", "ja", split="test", streaming=True, token=token)
ds = ds.cast_column("audio", datasets.Audio(sampling_rate=16_000))
input_speech = next(iter(ds))["audio"]["array"]
input_features = processor.feature_extractor(raw_speech=input_speech, return_tensors="pt").input_features.to(
torch_device