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
c6d5e565
Unverified
Commit
c6d5e565
authored
Feb 09, 2021
by
Julien Plu
Committed by
GitHub
Feb 09, 2021
Browse files
Fix naming (#10095)
parent
4ed76377
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
src/transformers/models/mobilebert/modeling_tf_mobilebert.py
src/transformers/models/mobilebert/modeling_tf_mobilebert.py
+3
-4
No files found.
src/transformers/models/mobilebert/modeling_tf_mobilebert.py
View file @
c6d5e565
...
...
@@ -1105,7 +1105,6 @@ class TFMobileBertForMaskedLM(TFMobileBertPreTrainedModel, TFMaskedLanguageModel
_keys_to_ignore_on_load_unexpected
=
[
r
"pooler"
,
r
"seq_relationship___cls"
,
r
"predictions___cls"
,
r
"cls.seq_relationship"
,
]
...
...
@@ -1113,10 +1112,10 @@ class TFMobileBertForMaskedLM(TFMobileBertPreTrainedModel, TFMaskedLanguageModel
super
().
__init__
(
config
,
*
inputs
,
**
kwargs
)
self
.
mobilebert
=
TFMobileBertMainLayer
(
config
,
add_pooling_layer
=
False
,
name
=
"mobilebert"
)
self
.
mlm
=
TFMobileBertMLMHead
(
config
,
name
=
"
mlm
___cls"
)
self
.
predictions
=
TFMobileBertMLMHead
(
config
,
name
=
"
predictions
___cls"
)
def
get_lm_head
(
self
):
return
self
.
mlm
.
predictions
return
self
.
predictions
.
predictions
def
get_prefix_bias_name
(
self
):
warnings
.
warn
(
"The method get_prefix_bias_name is deprecated. Please use `get_bias` instead."
,
FutureWarning
)
...
...
@@ -1179,7 +1178,7 @@ class TFMobileBertForMaskedLM(TFMobileBertPreTrainedModel, TFMaskedLanguageModel
training
=
inputs
[
"training"
],
)
sequence_output
=
outputs
[
0
]
prediction_scores
=
self
.
mlm
(
sequence_output
,
training
=
inputs
[
"training"
])
prediction_scores
=
self
.
predictions
(
sequence_output
,
training
=
inputs
[
"training"
])
loss
=
None
if
inputs
[
"labels"
]
is
None
else
self
.
compute_loss
(
inputs
[
"labels"
],
prediction_scores
)
...
...
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