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
eddf9eec
Unverified
Commit
eddf9eec
authored
Apr 21, 2023
by
Arthur
Committed by
GitHub
Apr 21, 2023
Browse files
[CI] clap patch fusion test values (#22922)
* patch test with values * lower tol
parent
5600e6f3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
41 deletions
+41
-41
tests/models/clap/test_feature_extraction_clap.py
tests/models/clap/test_feature_extraction_clap.py
+41
-41
No files found.
tests/models/clap/test_feature_extraction_clap.py
View file @
eddf9eec
...
...
@@ -431,16 +431,16 @@ class ClapFeatureExtractionTest(SequenceFeatureExtractionTestMixin, unittest.Tes
-
29.6947
],
[
-
9.208
3
,
-
7.296
6
,
-
6.209
7
,
-
7.995
7
,
-
2.92
79
,
-
11.184
4
,
-
6.14
87
,
5.073
8
,
19.2957
,
21.457
7
,
14.6803
,
-
3.31
48
,
-
6.33
28
,
-
2.35
37
,
6.95
11
,
15.296
3
,
14.66
18
,
5.207
8
,
-
0.08
68
,
1.1920
,
18.198
2
,
20.84
6
7
,
10.803
8
,
2.25
21
,
7.690
6
,
7.7427
,
-
1.254
1
,
-
5.0018
,
0.9809
,
-
2.158
2
,
-
5.45
76
,
-
5.47
58
,
-
11.888
3
,
-
9.0605
,
-
8.463
9
,
-
9.989
9
,
-
0.054
3
,
-
5.162
8
,
0.048
1
,
-
4.150
5
,
-
4.814
1
,
-
7.823
5
,
-
9.062
1
,
-
10.1742
,
-
8.959
6
,
-
11.53
77
,
-
16.5
596
,
-
17.185
2
,
-
17.502
7
,
-
20.932
2
,
-
23.953
8
,
-
25.260
0
,
-
25.342
6
,
-
27.453
4
,
-
26.885
7
,
-
22.785
1
,
-
25.828
6
,
-
24.839
5
,
-
23.88
8
9
,
-
24.209
3
,
-
26.5415
,
-
23.728
0
,
-
25.68
49
,
-
22.362
8
-
9.20
7
8
,
-
7.296
3
,
-
6.209
5
,
-
7.995
9
,
-
2.92
80
,
-
11.184
3
,
-
6.14
90
,
5.073
3
,
19.2957
,
21.457
8
,
14.6803
,
-
3.31
53
,
-
6.33
34
,
-
2.35
42
,
6.95
09
,
15.296
5
,
14.66
20
,
5.207
5
,
-
0.08
73
,
1.1919
,
18.198
6
,
20.847
0
,
10.803
5
,
2.25
16
,
7.690
5
,
7.7427
,
-
1.254
3
,
-
5.0018
,
0.9809
,
-
2.158
4
,
-
5.45
80
,
-
5.47
60
,
-
11.888
8
,
-
9.0605
,
-
8.463
8
,
-
9.989
7
,
-
0.054
0
,
-
5.162
9
,
0.048
3
,
-
4.150
4
,
-
4.814
0
,
-
7.823
6
,
-
9.062
2
,
-
10.1742
,
-
8.959
7
,
-
11.53
80
,
-
16.5
603
,
-
17.185
8
,
-
17.50
3
2
,
-
20.932
6
,
-
23.95
4
3
,
-
25.260
2
,
-
25.342
9
,
-
27.453
6
,
-
26.885
9
,
-
22.785
2
,
-
25.828
8
,
-
24.839
9
,
-
23.889
3
,
-
24.209
6
,
-
26.5415
,
-
23.728
1
,
-
25.68
51
,
-
22.362
9
],
[
1.3448
,
2.9883
,
4.0366
,
-
0.8019
,
-
10.4191
,
-
10.0883
,
-
4.3812
,
...
...
@@ -461,12 +461,12 @@ class ClapFeatureExtractionTest(SequenceFeatureExtractionTestMixin, unittest.Tes
input_speech
=
torch
.
cat
([
torch
.
tensor
(
x
)
for
x
in
self
.
_load_datasamples
(
5
)])
feature_extractor
=
ClapFeatureExtractor
()
for
padding
,
EXPECTED_VALUES
,
block_idx
in
zip
(
[
"repeat"
,
"repeatpad"
,
None
,
"pad"
],
EXPECTED_INPUT_FEATURES
,
[
0
,
1
,
3
,
2
]
[
"repeat"
,
"repeatpad"
,
None
,
"pad"
],
EXPECTED_INPUT_FEATURES
,
[
1
,
2
,
0
,
3
]
):
set_seed
(
987654321
)
input_features
=
feature_extractor
(
input_speech
,
return_tensors
=
"pt"
,
padding
=
padding
).
input_features
self
.
assertEqual
(
input_features
.
shape
,
(
1
,
4
,
1001
,
64
))
self
.
assertTrue
(
torch
.
allclose
(
input_features
[
0
,
block_idx
,
MEL_BIN
],
EXPECTED_VALUES
,
atol
=
1e-
4
))
self
.
assertTrue
(
torch
.
allclose
(
input_features
[
0
,
block_idx
,
MEL_BIN
],
EXPECTED_VALUES
,
atol
=
1e-
3
))
def
test_integration_rand_trunc_long_input
(
self
):
# fmt: off
...
...
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