Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
daf0d6a9
Unverified
Commit
daf0d6a9
authored
May 13, 2021
by
Lysandre Debut
Committed by
GitHub
May 13, 2021
Browse files
Fix gpt-2 warnings (#11709)
parent
37ed3ab7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/transformers/models/gpt2/modeling_gpt2.py
src/transformers/models/gpt2/modeling_gpt2.py
+4
-0
No files found.
src/transformers/models/gpt2/modeling_gpt2.py
View file @
daf0d6a9
...
@@ -569,6 +569,8 @@ DEPARALLELIZE_DOCSTRING = r"""
...
@@ -569,6 +569,8 @@ DEPARALLELIZE_DOCSTRING = r"""
GPT2_START_DOCSTRING
,
GPT2_START_DOCSTRING
,
)
)
class
GPT2Model
(
GPT2PreTrainedModel
):
class
GPT2Model
(
GPT2PreTrainedModel
):
_keys_to_ignore_on_load_missing
=
[
"attn.masked_bias"
]
def
__init__
(
self
,
config
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
super
().
__init__
(
config
)
...
@@ -1007,6 +1009,8 @@ input sequence).
...
@@ -1007,6 +1009,8 @@ input sequence).
GPT2_START_DOCSTRING
,
GPT2_START_DOCSTRING
,
)
)
class
GPT2DoubleHeadsModel
(
GPT2PreTrainedModel
):
class
GPT2DoubleHeadsModel
(
GPT2PreTrainedModel
):
_keys_to_ignore_on_load_missing
=
[
r
"attn.masked_bias"
,
r
"attn.bias"
,
r
"lm_head.weight"
]
def
__init__
(
self
,
config
):
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
super
().
__init__
(
config
)
config
.
num_labels
=
1
config
.
num_labels
=
1
...
...
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