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
adbf3a40
Unverified
Commit
adbf3a40
authored
Sep 12, 2022
by
Shijie Wu
Committed by
GitHub
Sep 12, 2022
Browse files
Remove dropout in embedding layer of OPT (#18845)
parent
36702600
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
4 deletions
+0
-4
src/transformers/models/opt/modeling_flax_opt.py
src/transformers/models/opt/modeling_flax_opt.py
+0
-2
src/transformers/models/opt/modeling_opt.py
src/transformers/models/opt/modeling_opt.py
+0
-1
src/transformers/models/opt/modeling_tf_opt.py
src/transformers/models/opt/modeling_tf_opt.py
+0
-1
No files found.
src/transformers/models/opt/modeling_flax_opt.py
View file @
adbf3a40
...
@@ -484,8 +484,6 @@ class FlaxOPTDecoder(nn.Module):
...
@@ -484,8 +484,6 @@ class FlaxOPTDecoder(nn.Module):
hidden_states
=
inputs_embeds
+
positions
hidden_states
=
inputs_embeds
+
positions
hidden_states
=
self
.
dropout_layer
(
hidden_states
,
deterministic
=
deterministic
)
hidden_state
,
all_hidden_states
,
attentions
=
self
.
layers
(
hidden_state
,
all_hidden_states
,
attentions
=
self
.
layers
(
hidden_states
,
hidden_states
,
attention_mask
,
attention_mask
,
...
...
src/transformers/models/opt/modeling_opt.py
View file @
adbf3a40
...
@@ -637,7 +637,6 @@ class OPTDecoder(OPTPreTrainedModel):
...
@@ -637,7 +637,6 @@ class OPTDecoder(OPTPreTrainedModel):
inputs_embeds
=
self
.
project_in
(
inputs_embeds
)
inputs_embeds
=
self
.
project_in
(
inputs_embeds
)
hidden_states
=
inputs_embeds
+
pos_embeds
hidden_states
=
inputs_embeds
+
pos_embeds
hidden_states
=
nn
.
functional
.
dropout
(
hidden_states
,
p
=
self
.
dropout
,
training
=
self
.
training
)
# decoder layers
# decoder layers
all_hidden_states
=
()
if
output_hidden_states
else
None
all_hidden_states
=
()
if
output_hidden_states
else
None
...
...
src/transformers/models/opt/modeling_tf_opt.py
View file @
adbf3a40
...
@@ -652,7 +652,6 @@ class TFOPTDecoder(tf.keras.layers.Layer):
...
@@ -652,7 +652,6 @@ class TFOPTDecoder(tf.keras.layers.Layer):
inputs_embeds
=
self
.
project_in
(
inputs_embeds
)
inputs_embeds
=
self
.
project_in
(
inputs_embeds
)
hidden_states
=
inputs_embeds
+
pos_embeds
hidden_states
=
inputs_embeds
+
pos_embeds
hidden_states
=
self
.
dropout
(
hidden_states
,
training
=
training
)
# decoder layers
# decoder layers
all_hidden_states
=
()
if
output_hidden_states
else
None
all_hidden_states
=
()
if
output_hidden_states
else
None
...
...
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