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
3c6d73bc
Commit
3c6d73bc
authored
Aug 16, 2021
by
Lysandre
Browse files
Fix BERT/MobileBERT classifier dropout
parent
7d2feb3a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/transformers/models/bert/modeling_bert.py
src/transformers/models/bert/modeling_bert.py
+1
-1
src/transformers/models/mobilebert/modeling_mobilebert.py
src/transformers/models/mobilebert/modeling_mobilebert.py
+1
-1
No files found.
src/transformers/models/bert/modeling_bert.py
View file @
3c6d73bc
...
@@ -1585,7 +1585,7 @@ class BertForMultipleChoice(BertPreTrainedModel):
...
@@ -1585,7 +1585,7 @@ class BertForMultipleChoice(BertPreTrainedModel):
super
().
__init__
(
config
)
super
().
__init__
(
config
)
self
.
bert
=
BertModel
(
config
)
self
.
bert
=
BertModel
(
config
)
self
.
dropout
=
nn
.
Dropout
(
config
.
classifier_dropout
_prob
)
self
.
dropout
=
nn
.
Dropout
(
config
.
classifier_dropout
)
self
.
classifier
=
nn
.
Linear
(
config
.
hidden_size
,
1
)
self
.
classifier
=
nn
.
Linear
(
config
.
hidden_size
,
1
)
self
.
init_weights
()
self
.
init_weights
()
...
...
src/transformers/models/mobilebert/modeling_mobilebert.py
View file @
3c6d73bc
...
@@ -1415,7 +1415,7 @@ class MobileBertForMultipleChoice(MobileBertPreTrainedModel):
...
@@ -1415,7 +1415,7 @@ class MobileBertForMultipleChoice(MobileBertPreTrainedModel):
super
().
__init__
(
config
)
super
().
__init__
(
config
)
self
.
mobilebert
=
MobileBertModel
(
config
)
self
.
mobilebert
=
MobileBertModel
(
config
)
self
.
dropout
=
nn
.
Dropout
(
config
.
hidden
_dropout
_prob
)
self
.
dropout
=
nn
.
Dropout
(
config
.
classifier
_dropout
)
self
.
classifier
=
nn
.
Linear
(
config
.
hidden_size
,
1
)
self
.
classifier
=
nn
.
Linear
(
config
.
hidden_size
,
1
)
self
.
init_weights
()
self
.
init_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