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
b1116fd6
Commit
b1116fd6
authored
Mar 03, 2020
by
Gunnlaugur Thor Briem
Browse files
fix: passing config as Layer trainable param
Lurking bugs discovered while working on other stuff.
parent
e9e6efdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/transformers/modeling_tf_albert.py
src/transformers/modeling_tf_albert.py
+1
-1
src/transformers/modeling_tf_openai.py
src/transformers/modeling_tf_openai.py
+1
-1
No files found.
src/transformers/modeling_tf_albert.py
View file @
b1116fd6
...
@@ -480,7 +480,7 @@ class TFAlbertMLMHead(tf.keras.layers.Layer):
...
@@ -480,7 +480,7 @@ class TFAlbertMLMHead(tf.keras.layers.Layer):
class
TFAlbertMainLayer
(
tf
.
keras
.
layers
.
Layer
):
class
TFAlbertMainLayer
(
tf
.
keras
.
layers
.
Layer
):
def
__init__
(
self
,
config
,
**
kwargs
):
def
__init__
(
self
,
config
,
**
kwargs
):
super
().
__init__
(
config
,
**
kwargs
)
super
().
__init__
(
**
kwargs
)
self
.
num_hidden_layers
=
config
.
num_hidden_layers
self
.
num_hidden_layers
=
config
.
num_hidden_layers
self
.
embeddings
=
TFAlbertEmbeddings
(
config
,
name
=
"embeddings"
)
self
.
embeddings
=
TFAlbertEmbeddings
(
config
,
name
=
"embeddings"
)
...
...
src/transformers/modeling_tf_openai.py
View file @
b1116fd6
...
@@ -199,7 +199,7 @@ class TFBlock(tf.keras.layers.Layer):
...
@@ -199,7 +199,7 @@ class TFBlock(tf.keras.layers.Layer):
class
TFOpenAIGPTMainLayer
(
tf
.
keras
.
layers
.
Layer
):
class
TFOpenAIGPTMainLayer
(
tf
.
keras
.
layers
.
Layer
):
def
__init__
(
self
,
config
,
*
inputs
,
**
kwargs
):
def
__init__
(
self
,
config
,
*
inputs
,
**
kwargs
):
super
().
__init__
(
config
,
*
inputs
,
**
kwargs
)
super
().
__init__
(
*
inputs
,
**
kwargs
)
self
.
output_hidden_states
=
config
.
output_hidden_states
self
.
output_hidden_states
=
config
.
output_hidden_states
self
.
output_attentions
=
config
.
output_attentions
self
.
output_attentions
=
config
.
output_attentions
self
.
num_hidden_layers
=
config
.
n_layer
self
.
num_hidden_layers
=
config
.
n_layer
...
...
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