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 Apr 30, 2021
1 parent 3d3e1d8 commit 1cfedeb
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 1cfedeb

Please sign in to comment.