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
cfcb9541
Commit
cfcb9541
authored
Feb 08, 2019
by
thomwolf
Browse files
fix hasattr
parent
0c1a6f9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
pytorch_pretrained_bert/modeling_transfo_xl.py
pytorch_pretrained_bert/modeling_transfo_xl.py
+1
-1
No files found.
pytorch_pretrained_bert/modeling_transfo_xl.py
View file @
cfcb9541
...
...
@@ -970,7 +970,7 @@ class TransfoXLPreTrainedModel(nn.Module):
raise
RuntimeError
(
'Error(s) in loading state_dict for {}:
\n\t
{}'
.
format
(
model
.
__class__
.
__name__
,
"
\n\t
"
.
join
(
error_msgs
)))
# Make sure we are still sharing the input and output embeddings
if
model
.
hasattr
(
'tie_weights'
):
if
hasattr
(
model
,
'tie_weights'
):
model
.
tie_weights
()
return
model
...
...
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