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
607611f2
Unverified
Commit
607611f2
authored
Sep 06, 2021
by
Patrick von Platen
Committed by
GitHub
Sep 06, 2021
Browse files
up (#13448)
parent
6b29bff8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
tests/test_modeling_encoder_decoder.py
tests/test_modeling_encoder_decoder.py
+2
-0
No files found.
tests/test_modeling_encoder_decoder.py
View file @
607611f2
...
@@ -201,6 +201,7 @@ class EncoderDecoderMixin:
...
@@ -201,6 +201,7 @@ class EncoderDecoderMixin:
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
enc_dec_model
.
save_pretrained
(
tmpdirname
)
enc_dec_model
.
save_pretrained
(
tmpdirname
)
enc_dec_model
=
EncoderDecoderModel
.
from_pretrained
(
tmpdirname
)
enc_dec_model
=
EncoderDecoderModel
.
from_pretrained
(
tmpdirname
)
enc_dec_model
.
to
(
torch_device
)
after_outputs
=
enc_dec_model
(
after_outputs
=
enc_dec_model
(
input_ids
=
input_ids
,
input_ids
=
input_ids
,
...
@@ -245,6 +246,7 @@ class EncoderDecoderMixin:
...
@@ -245,6 +246,7 @@ class EncoderDecoderMixin:
encoder_pretrained_model_name_or_path
=
encoder_tmp_dirname
,
encoder_pretrained_model_name_or_path
=
encoder_tmp_dirname
,
decoder_pretrained_model_name_or_path
=
decoder_tmp_dirname
,
decoder_pretrained_model_name_or_path
=
decoder_tmp_dirname
,
)
)
enc_dec_model
.
to
(
torch_device
)
after_outputs
=
enc_dec_model
(
after_outputs
=
enc_dec_model
(
input_ids
=
input_ids
,
input_ids
=
input_ids
,
...
...
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