Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
3dae0d7b
Unverified
Commit
3dae0d7b
authored
Feb 24, 2023
by
Sanchit Gandhi
Committed by
GitHub
Feb 24, 2023
Browse files
[SpeechT5] Fix HiFiGAN tests (#21788)
parent
59c1d5b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
tests/models/speecht5/test_modeling_speecht5.py
tests/models/speecht5/test_modeling_speecht5.py
+10
-2
No files found.
tests/models/speecht5/test_modeling_speecht5.py
View file @
3dae0d7b
...
...
@@ -1551,9 +1551,13 @@ class SpeechT5HifiGanTest(ModelTesterMixin, unittest.TestCase):
for
model_class
in
self
.
all_model_classes
:
model
=
model_class
(
config
)
model
.
to
(
torch_device
)
model
.
eval
()
batched_inputs
=
inputs
[
"spectrogram"
].
unsqueeze
(
0
).
repeat
(
2
,
1
,
1
)
with
torch
.
no_grad
():
batched_outputs
=
model
(
batched_inputs
.
to
(
torch_device
))
batched_outputs
=
model
(
batched_inputs
)
self
.
assertEqual
(
batched_inputs
.
shape
[
0
],
batched_outputs
.
shape
[
0
],
msg
=
"Got different batch dims for input and output"
)
...
...
@@ -1563,5 +1567,9 @@ class SpeechT5HifiGanTest(ModelTesterMixin, unittest.TestCase):
for
model_class
in
self
.
all_model_classes
:
model
=
model_class
(
config
)
outputs
=
model
(
inputs
[
"spectrogram"
])
model
.
to
(
torch_device
)
model
.
eval
()
with
torch
.
no_grad
():
outputs
=
model
(
inputs
[
"spectrogram"
].
to
(
torch_device
))
self
.
assertTrue
(
outputs
.
dim
()
==
1
,
msg
=
"Got un-batched inputs but batched output"
)
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