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
d1691d90
Unverified
Commit
d1691d90
authored
Sep 10, 2020
by
Sylvain Gugger
Committed by
GitHub
Sep 10, 2020
Browse files
Samell fixed in tf template (#7044)
parent
63e53945
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
templates/adding_a_new_model/modeling_tf_xxx.py
templates/adding_a_new_model/modeling_tf_xxx.py
+4
-4
No files found.
templates/adding_a_new_model/modeling_tf_xxx.py
View file @
d1691d90
...
@@ -19,9 +19,6 @@
...
@@ -19,9 +19,6 @@
# In this template, replace all the XXX (various casings) with your model name
# In this template, replace all the XXX (various casings) with your model name
####################################################
####################################################
import
logging
import
tensorflow
as
tf
import
tensorflow
as
tf
from
.configuration_xxx
import
XxxConfig
from
.configuration_xxx
import
XxxConfig
...
@@ -47,12 +44,14 @@ from .modeling_tf_utils import (
...
@@ -47,12 +44,14 @@ from .modeling_tf_utils import (
TFSequenceClassificationLoss
,
TFSequenceClassificationLoss
,
TFTokenClassificationLoss
,
TFTokenClassificationLoss
,
get_initializer
,
get_initializer
,
keras_serializable
,
shape_list
,
shape_list
,
)
)
from
.tokenization_utils
import
BatchEncoding
from
.tokenization_utils
import
BatchEncoding
from
.utils
import
logging
logger
=
logging
.
get
L
ogger
(
__name__
)
logger
=
logging
.
get
_l
ogger
(
__name__
)
_CONFIG_FOR_DOC
=
"XXXConfig"
_CONFIG_FOR_DOC
=
"XXXConfig"
_TOKENIZER_FOR_DOC
=
"XxxTokenizer"
_TOKENIZER_FOR_DOC
=
"XxxTokenizer"
...
@@ -115,6 +114,7 @@ class TFXxxLayer(tf.keras.layers.Layer):
...
@@ -115,6 +114,7 @@ class TFXxxLayer(tf.keras.layers.Layer):
# The full model without a specific pretrained or finetuning head is
# The full model without a specific pretrained or finetuning head is
# provided as a tf.keras.layers.Layer usually called "TFXxxMainLayer"
# provided as a tf.keras.layers.Layer usually called "TFXxxMainLayer"
####################################################
####################################################
@
keras_serializable
class
TFXxxMainLayer
(
tf
.
keras
.
layers
.
Layer
):
class
TFXxxMainLayer
(
tf
.
keras
.
layers
.
Layer
):
def
__init__
(
self
,
config
,
**
kwargs
):
def
__init__
(
self
,
config
,
**
kwargs
):
super
().
__init__
(
**
kwargs
)
super
().
__init__
(
**
kwargs
)
...
...
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