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
d2904264
Unverified
Commit
d2904264
authored
Sep 13, 2021
by
Patrick von Platen
Committed by
GitHub
Sep 13, 2021
Browse files
up (#13538)
parent
65ee1a43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
tests/test_feature_extraction_speech_to_text.py
tests/test_feature_extraction_speech_to_text.py
+6
-2
No files found.
tests/test_feature_extraction_speech_to_text.py
View file @
d2904264
...
@@ -139,7 +139,9 @@ class Speech2TextFeatureExtractionTest(SequenceFeatureExtractionTestMixin, unitt
...
@@ -139,7 +139,9 @@ class Speech2TextFeatureExtractionTest(SequenceFeatureExtractionTestMixin, unitt
paddings
=
[
"longest"
,
"max_length"
,
"do_not_pad"
]
paddings
=
[
"longest"
,
"max_length"
,
"do_not_pad"
]
max_lengths
=
[
None
,
16
,
None
]
max_lengths
=
[
None
,
16
,
None
]
var_tolerances
=
[
1e-3
,
1e-3
,
1e-1
]
var_tolerances
=
[
1e-3
,
1e-3
,
5e-1
]
# TODO(Patrick, Suraj, Anton) - It's surprising that "non-padded/non-numpified" padding
# results in quite inaccurate variance computation after (see 5e-1 tolerance)
for
max_length
,
padding
,
var_tol
in
zip
(
max_lengths
,
paddings
,
var_tolerances
):
for
max_length
,
padding
,
var_tol
in
zip
(
max_lengths
,
paddings
,
var_tolerances
):
inputs
=
feature_extractor
(
inputs
=
feature_extractor
(
...
@@ -163,7 +165,9 @@ class Speech2TextFeatureExtractionTest(SequenceFeatureExtractionTestMixin, unitt
...
@@ -163,7 +165,9 @@ class Speech2TextFeatureExtractionTest(SequenceFeatureExtractionTestMixin, unitt
paddings
=
[
"longest"
,
"max_length"
,
"do_not_pad"
]
paddings
=
[
"longest"
,
"max_length"
,
"do_not_pad"
]
max_lengths
=
[
None
,
16
,
None
]
max_lengths
=
[
None
,
16
,
None
]
var_tolerances
=
[
1e-3
,
1e-3
,
1e-1
]
var_tolerances
=
[
1e-3
,
1e-3
,
5e-1
]
# TODO(Patrick, Suraj, Anton) - It's surprising that "non-padded/non-numpified" padding
# results in quite inaccurate variance computation after (see 5e-1 tolerance)
for
max_length
,
padding
,
var_tol
in
zip
(
max_lengths
,
paddings
,
var_tolerances
):
for
max_length
,
padding
,
var_tol
in
zip
(
max_lengths
,
paddings
,
var_tolerances
):
inputs
=
feature_extractor
(
inputs
=
feature_extractor
(
speech_inputs
,
max_length
=
max_length
,
padding
=
padding
,
return_tensors
=
"np"
,
return_attention_mask
=
True
speech_inputs
,
max_length
=
max_length
,
padding
=
padding
,
return_tensors
=
"np"
,
return_attention_mask
=
True
...
...
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