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
6587cf9f
Unverified
Commit
6587cf9f
authored
Dec 14, 2020
by
Lysandre Debut
Committed by
GitHub
Dec 14, 2020
Browse files
Patch *ForCausalLM model (#9092)
parent
51d9c569
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py
...ame}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py
+6
-0
No files found.
templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py
View file @
6587cf9f
...
@@ -872,6 +872,12 @@ class TF{{cookiecutter.camelcase_modelname}}ForCausalLM(TF{{cookiecutter.camelca
...
@@ -872,6 +872,12 @@ class TF{{cookiecutter.camelcase_modelname}}ForCausalLM(TF{{cookiecutter.camelca
def
get_output_embeddings
(
self
):
def
get_output_embeddings
(
self
):
return
self
.{{
cookiecutter
.
lowercase_modelname
}}.
embeddings
return
self
.{{
cookiecutter
.
lowercase_modelname
}}.
embeddings
def
get_output_layer_with_bias
(
self
):
return
self
.
mlm
.
predictions
def
get_prefix_bias_name
(
self
):
return
self
.
name
+
"/"
+
self
.
mlm
.
name
+
"/"
+
self
.
mlm
.
predictions
.
name
@
add_code_sample_docstrings
(
@
add_code_sample_docstrings
(
tokenizer_class
=
_TOKENIZER_FOR_DOC
,
tokenizer_class
=
_TOKENIZER_FOR_DOC
,
checkpoint
=
"{{cookiecutter.checkpoint_identifier}}"
,
checkpoint
=
"{{cookiecutter.checkpoint_identifier}}"
,
...
...
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