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
f1a565a3
Unverified
Commit
f1a565a3
authored
Mar 12, 2024
by
tomigee
Committed by
GitHub
Mar 12, 2024
Browse files
Implemented add_pooling_layer arg to TFBertModel (#29603)
Implemented add_pooling_layer argument
parent
50ec4933
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/models/bert/modeling_tf_bert.py
src/transformers/models/bert/modeling_tf_bert.py
+2
-2
No files found.
src/transformers/models/bert/modeling_tf_bert.py
View file @
f1a565a3
...
...
@@ -1182,10 +1182,10 @@ BERT_INPUTS_DOCSTRING = r"""
BERT_START_DOCSTRING
,
)
class
TFBertModel
(
TFBertPreTrainedModel
):
def
__init__
(
self
,
config
:
BertConfig
,
*
inputs
,
**
kwargs
):
def
__init__
(
self
,
config
:
BertConfig
,
add_pooling_layer
:
bool
=
True
,
*
inputs
,
**
kwargs
):
super
().
__init__
(
config
,
*
inputs
,
**
kwargs
)
self
.
bert
=
TFBertMainLayer
(
config
,
name
=
"bert"
)
self
.
bert
=
TFBertMainLayer
(
config
,
add_pooling_layer
,
name
=
"bert"
)
@
unpack_inputs
@
add_start_docstrings_to_model_forward
(
BERT_INPUTS_DOCSTRING
.
format
(
"batch_size, sequence_length"
))
...
...
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