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
6bca56fd
Commit
6bca56fd
authored
Dec 24, 2019
by
patrickvonplaten
Browse files
check for self.config.mem_len instead of self.mem_len in _do_output_past
parent
365ccd0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+1
-1
No files found.
src/transformers/modeling_utils.py
View file @
6bca56fd
...
@@ -544,7 +544,7 @@ class PreTrainedModel(nn.Module):
...
@@ -544,7 +544,7 @@ class PreTrainedModel(nn.Module):
# individual class as is done for prepare_inputs_for_generation
# individual class as is done for prepare_inputs_for_generation
has_output_past
=
hasattr
(
self
.
config
,
'output_past'
)
and
self
.
config
.
output_past
has_output_past
=
hasattr
(
self
.
config
,
'output_past'
)
and
self
.
config
.
output_past
has_multiple_outputs
=
len
(
outputs
)
>
1
has_multiple_outputs
=
len
(
outputs
)
>
1
has_mem_len
=
hasattr
(
self
,
'mem_len'
)
has_mem_len
=
hasattr
(
self
.
config
,
'mem_len'
)
if
has_output_past
and
has_multiple_outputs
and
not
has_mem_len
:
if
has_output_past
and
has_multiple_outputs
and
not
has_mem_len
:
return
True
return
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