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
ee2a3400
Unverified
Commit
ee2a3400
authored
Feb 06, 2024
by
Eran Hirsch
Committed by
GitHub
Feb 06, 2024
Browse files
Fix LongT5ForConditionalGeneration initialization of lm_head (#28873)
parent
1ea0bbd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/transformers/models/longt5/modeling_longt5.py
src/transformers/models/longt5/modeling_longt5.py
+2
-0
No files found.
src/transformers/models/longt5/modeling_longt5.py
View file @
ee2a3400
...
...
@@ -1301,6 +1301,8 @@ class LongT5PreTrainedModel(PreTrainedModel):
# Mesh TensorFlow embeddings initialization
# See https://github.com/tensorflow/mesh/blob/fa19d69eafc9a482aff0b59ddd96b025c0cb207d/mesh_tensorflow/layers.py#L1624
module
.
shared
.
weight
.
data
.
normal_
(
mean
=
0.0
,
std
=
factor
*
1.0
)
if
hasattr
(
module
,
"lm_head"
)
and
not
self
.
config
.
tie_word_embeddings
:
module
.
lm_head
.
weight
.
data
.
normal_
(
mean
=
0.0
,
std
=
factor
*
1.0
)
elif
isinstance
(
module
,
LongT5DenseActDense
):
# Mesh TensorFlow FF initialization
# See https://github.com/tensorflow/mesh/blob/master/mesh_tensorflow/transformer/transformer_layers.py#L56
...
...
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