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
b7345d22
Unverified
Commit
b7345d22
authored
Jul 27, 2020
by
Sam Shleifer
Committed by
GitHub
Jul 27, 2020
Browse files
[fix] no warning for position_ids buffer (#6063)
parent
1e00ef68
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
1 deletion
+8
-1
src/transformers/modeling_bert.py
src/transformers/modeling_bert.py
+2
-0
src/transformers/modeling_mobilebert.py
src/transformers/modeling_mobilebert.py
+2
-0
src/transformers/modeling_openai.py
src/transformers/modeling_openai.py
+1
-0
src/transformers/modeling_xlm.py
src/transformers/modeling_xlm.py
+3
-1
No files found.
src/transformers/modeling_bert.py
View file @
b7345d22
...
...
@@ -699,6 +699,8 @@ class BertModel(BertPreTrainedModel):
"""
authorized_missing_keys
=
[
r
"position_ids"
]
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
self
.
config
=
config
...
...
src/transformers/modeling_mobilebert.py
View file @
b7345d22
...
...
@@ -788,6 +788,8 @@ class MobileBertModel(MobileBertPreTrainedModel):
https://arxiv.org/pdf/2004.02984.pdf
"""
authorized_missing_keys
=
[
r
"position_ids"
]
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
self
.
config
=
config
...
...
src/transformers/modeling_openai.py
View file @
b7345d22
...
...
@@ -272,6 +272,7 @@ class OpenAIGPTPreTrainedModel(PreTrainedModel):
config_class
=
OpenAIGPTConfig
load_tf_weights
=
load_tf_weights_in_openai_gpt
base_model_prefix
=
"transformer"
authorized_missing_keys
=
[
r
"position_ids"
]
def
_init_weights
(
self
,
module
):
""" Initialize the weights.
...
...
src/transformers/modeling_xlm.py
View file @
b7345d22
...
...
@@ -375,7 +375,9 @@ XLM_INPUTS_DOCSTRING = r"""
XLM_START_DOCSTRING
,
)
class
XLMModel
(
XLMPreTrainedModel
):
def
__init__
(
self
,
config
):
# , dico, is_encoder, with_output):
authorized_missing_keys
=
[
r
"position_ids"
]
def
__init__
(
self
,
config
):
super
().
__init__
(
config
)
# encoder / decoder, output layer
...
...
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