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
50e62a4c
Commit
50e62a4c
authored
Jul 11, 2019
by
LysandreJik
Browse files
fix gpt/gpt-2 from pretrained
parent
273617b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
pytorch_transformers/modeling_gpt2.py
pytorch_transformers/modeling_gpt2.py
+1
-1
No files found.
pytorch_transformers/modeling_gpt2.py
View file @
50e62a4c
...
...
@@ -423,7 +423,7 @@ class GPT2PreTrainedModel(PreTrainedModel):
"""
num_special_tokens
=
kwargs
.
pop
(
'num_special_tokens'
,
None
)
model
=
super
(
PreTrainedModel
,
cls
).
from_pretrained
(
pretrained_model_name_or_path
,
*
inputs
,
**
kwargs
)
model
=
super
().
from_pretrained
(
pretrained_model_name_or_path
,
*
inputs
,
**
kwargs
)
# Add additional embeddings for special tokens if needed
# This step also make sure we are still sharing the output and input embeddings after loading weights
...
...
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