diff --git a/tests/test_pipelines_automatic_speech_recognition.py b/tests/test_pipelines_automatic_speech_recognition.py index eebdc477b0dd18..6d391eee9a934c 100644 --- a/tests/test_pipelines_automatic_speech_recognition.py +++ b/tests/test_pipelines_automatic_speech_recognition.py @@ -34,14 +34,14 @@ def test_pt_defaults(self): def test_torch_small(self): import numpy as np - nlp = pipeline( + speech_recognizer = pipeline( task="automatic-speech-recognition", model="facebook/s2t-small-mustc-en-fr-st", tokenizer="facebook/s2t-small-mustc-en-fr-st", framework="pt", ) waveform = np.zeros((34000,)) - output = nlp(waveform) + output = speech_recognizer(waveform) self.assertEqual(output, {"text": "C'est ce que j'ai fait à ce moment-là."}) @require_datasets @@ -50,21 +50,21 @@ def test_torch_small(self): def test_torch_large(self): import numpy as np - nlp = pipeline( + speech_recognizer = pipeline( task="automatic-speech-recognition", model="facebook/wav2vec2-base-960h", tokenizer="facebook/wav2vec2-base-960h", framework="pt", ) waveform = np.zeros((34000,)) - output = nlp(waveform) + output = speech_recognizer(waveform) self.assertEqual(output, {"text": ""}) from datasets import load_dataset ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation") filename = ds[0]["file"] - output = nlp(filename) + output = speech_recognizer(filename) self.assertEqual(output, {"text": "A MAN SAID TO THE UNIVERSE SIR I EXIST"}) @slow