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
7996ef74
Unverified
Commit
7996ef74
authored
Jul 27, 2022
by
Younes Belkada
Committed by
GitHub
Jul 27, 2022
Browse files
fix module order (#18312)
- put gelu before 4h to h
parent
70e7d1d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/bloom/modeling_bloom.py
src/transformers/models/bloom/modeling_bloom.py
+1
-1
No files found.
src/transformers/models/bloom/modeling_bloom.py
View file @
7996ef74
...
@@ -352,9 +352,9 @@ class BloomMLP(nn.Module):
...
@@ -352,9 +352,9 @@ class BloomMLP(nn.Module):
self
.
pretraining_tp
=
config
.
pretraining_tp
self
.
pretraining_tp
=
config
.
pretraining_tp
self
.
slow_but_exact
=
config
.
slow_but_exact
self
.
slow_but_exact
=
config
.
slow_but_exact
self
.
dense_h_to_4h
=
nn
.
Linear
(
hidden_size
,
4
*
hidden_size
)
self
.
dense_h_to_4h
=
nn
.
Linear
(
hidden_size
,
4
*
hidden_size
)
self
.
gelu_impl
=
BloomGelu
()
self
.
dense_4h_to_h
=
nn
.
Linear
(
4
*
hidden_size
,
hidden_size
)
self
.
dense_4h_to_h
=
nn
.
Linear
(
4
*
hidden_size
,
hidden_size
)
self
.
hidden_dropout
=
config
.
hidden_dropout
self
.
hidden_dropout
=
config
.
hidden_dropout
self
.
gelu_impl
=
BloomGelu
()
def
forward
(
self
,
hidden_states
,
residual
):
def
forward
(
self
,
hidden_states
,
residual
):
hidden_states
=
self
.
gelu_impl
(
self
.
dense_h_to_4h
(
hidden_states
))
hidden_states
=
self
.
gelu_impl
(
self
.
dense_h_to_4h
(
hidden_states
))
...
...
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