Unverified Commit dfe9a319 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Update `AudioClassificationPipelineTests::test_small_model_pt` for PT 2.0.0 (#22023)



fix
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent bbd94997
...@@ -88,15 +88,20 @@ class AudioClassificationPipelineTests(unittest.TestCase): ...@@ -88,15 +88,20 @@ class AudioClassificationPipelineTests(unittest.TestCase):
audio = np.ones((8000,)) audio = np.ones((8000,))
output = audio_classifier(audio, top_k=4) output = audio_classifier(audio, top_k=4)
self.assertEqual(
nested_simplify(output, decimals=4), EXPECTED_OUTPUT = [
[ {"score": 0.0842, "label": "no"},
{"score": 0.0842, "label": "no"}, {"score": 0.0838, "label": "up"},
{"score": 0.0838, "label": "up"}, {"score": 0.0837, "label": "go"},
{"score": 0.0837, "label": "go"}, {"score": 0.0834, "label": "right"},
{"score": 0.0834, "label": "right"}, ]
], EXPECTED_OUTPUT_PT_2 = [
) {"score": 0.0845, "label": "stop"},
{"score": 0.0844, "label": "on"},
{"score": 0.0841, "label": "right"},
{"score": 0.0834, "label": "left"},
]
self.assertIn(nested_simplify(output, decimals=4), [EXPECTED_OUTPUT, EXPECTED_OUTPUT_PT_2])
@require_torch @require_torch
@slow @slow
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment