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
c6cea5a7
Unverified
Commit
c6cea5a7
authored
Jun 08, 2022
by
Yih-Dar
Committed by
GitHub
Jun 08, 2022
Browse files
fix (#17589)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
119e3c0f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
src/transformers/models/mt5/configuration_mt5.py
src/transformers/models/mt5/configuration_mt5.py
+15
-0
No files found.
src/transformers/models/mt5/configuration_mt5.py
View file @
c6cea5a7
...
...
@@ -117,6 +117,21 @@ class MT5Config(PretrainedConfig):
self
.
feed_forward_proj
=
feed_forward_proj
self
.
use_cache
=
use_cache
act_info
=
self
.
feed_forward_proj
.
split
(
"-"
)
self
.
dense_act_fn
=
act_info
[
-
1
]
self
.
is_gated_act
=
act_info
[
0
]
==
"gated"
if
len
(
act_info
)
>
1
and
act_info
[
0
]
!=
"gated"
or
len
(
act_info
)
>
2
:
raise
ValueError
(
f
"`feed_forward_proj`:
{
feed_forward_proj
}
is not a valid activation function of the dense layer."
"Please make sure `feed_forward_proj` is of the format `gated-{ACT_FN}` or `{ACT_FN}`, e.g. "
"'gated-gelu' or 'relu'"
)
# for backwards compatibility
if
feed_forward_proj
==
"gated-gelu"
:
self
.
dense_act_fn
=
"gelu_new"
@
property
def
hidden_size
(
self
):
return
self
.
d_model
...
...
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