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
b4eef63a
Unverified
Commit
b4eef63a
authored
Jun 10, 2022
by
Patrick von Platen
Committed by
GitHub
Jun 10, 2022
Browse files
[Data2Vec] Speed up test (#17660)
parent
5e428b71
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tests/models/data2vec/test_modeling_data2vec_audio.py
tests/models/data2vec/test_modeling_data2vec_audio.py
+2
-2
No files found.
tests/models/data2vec/test_modeling_data2vec_audio.py
View file @
b4eef63a
...
@@ -535,7 +535,7 @@ class Data2VecAudioModelTest(ModelTesterMixin, unittest.TestCase):
...
@@ -535,7 +535,7 @@ class Data2VecAudioModelTest(ModelTesterMixin, unittest.TestCase):
def
test_mask_feature_prob_ctc
(
self
):
def
test_mask_feature_prob_ctc
(
self
):
model
=
Data2VecAudioForCTC
.
from_pretrained
(
model
=
Data2VecAudioForCTC
.
from_pretrained
(
"
facebook/data2vec-audio-base-960h
"
,
mask_feature_prob
=
0.2
,
mask_feature_length
=
2
"
hf-internal-testing/tiny-random-data2vec-seq-class
"
,
mask_feature_prob
=
0.2
,
mask_feature_length
=
2
)
)
model
.
to
(
torch_device
).
train
()
model
.
to
(
torch_device
).
train
()
processor
=
Wav2Vec2Processor
.
from_pretrained
(
processor
=
Wav2Vec2Processor
.
from_pretrained
(
...
@@ -554,7 +554,7 @@ class Data2VecAudioModelTest(ModelTesterMixin, unittest.TestCase):
...
@@ -554,7 +554,7 @@ class Data2VecAudioModelTest(ModelTesterMixin, unittest.TestCase):
attention_mask
=
batch
[
"attention_mask"
].
to
(
torch_device
),
attention_mask
=
batch
[
"attention_mask"
].
to
(
torch_device
),
).
logits
).
logits
self
.
assertEqual
(
logits
.
shape
,
(
4
,
299
,
32
))
self
.
assertEqual
(
logits
.
shape
,
(
4
,
1498
,
32
))
def
test_mask_time_prob_ctc
(
self
):
def
test_mask_time_prob_ctc
(
self
):
model
=
Data2VecAudioForCTC
.
from_pretrained
(
model
=
Data2VecAudioForCTC
.
from_pretrained
(
...
...
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