Skip to content

Commit

Permalink
Fix tests with speech_recognizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Narsil committed May 1, 2021
1 parent d30f5cc commit c885b0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_pipelines_automatic_speech_recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_torch_small(self):
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
Expand All @@ -56,14 +56,14 @@ def test_torch_large(self):
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
Expand Down

0 comments on commit c885b0f

Please sign in to comment.