Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
e30078b5
Unverified
Commit
e30078b5
authored
Nov 08, 2021
by
Anton Lozhkov
Committed by
GitHub
Nov 08, 2021
Browse files
[Tests] Update audio classification tests to support torch 1.10 (#14318)
parent
b48faae3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
tests/test_pipelines_audio_classification.py
tests/test_pipelines_audio_classification.py
+5
-6
No files found.
tests/test_pipelines_audio_classification.py
View file @
e30078b5
...
...
@@ -82,7 +82,6 @@ class AudioClassificationPipelineTests(unittest.TestCase, metaclass=PipelineTest
],
)
@
unittest
.
skip
(
"Skip tests while investigating difference between PyTorch 1.9 and 1.10"
)
@
require_torch
def
test_small_model_pt
(
self
):
model
=
"anton-l/wav2vec2-random-tiny-classifier"
...
...
@@ -94,10 +93,10 @@ class AudioClassificationPipelineTests(unittest.TestCase, metaclass=PipelineTest
self
.
assertEqual
(
nested_simplify
(
output
,
decimals
=
4
),
[
{
"score"
:
0.084
3
,
"label"
:
"
o
n"
},
{
"score"
:
0.08
40
,
"label"
:
"
left
"
},
{
"score"
:
0.0837
,
"label"
:
"o
ff
"
},
{
"score"
:
0.083
5
,
"label"
:
"
yes
"
},
{
"score"
:
0.084
2
,
"label"
:
"n
o
"
},
{
"score"
:
0.08
38
,
"label"
:
"
up
"
},
{
"score"
:
0.0837
,
"label"
:
"
g
o"
},
{
"score"
:
0.083
4
,
"label"
:
"
right
"
},
],
)
...
...
@@ -117,7 +116,7 @@ class AudioClassificationPipelineTests(unittest.TestCase, metaclass=PipelineTest
self
.
assertEqual
(
nested_simplify
(
output
,
decimals
=
4
),
[
{
"score"
:
0.98
1
,
"label"
:
"go"
},
{
"score"
:
0.98
09
,
"label"
:
"go"
},
{
"score"
:
0.0073
,
"label"
:
"up"
},
{
"score"
:
0.0064
,
"label"
:
"_unknown_"
},
{
"score"
:
0.0015
,
"label"
:
"down"
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment