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
e22b7ced
Unverified
Commit
e22b7ced
authored
Oct 31, 2023
by
Susnato Dhar
Committed by
GitHub
Oct 31, 2023
Browse files
Fix dropout in `StarCoder` (#27182)
fix dropout in modeling_gpt_bigcode.py
parent
4bb50aa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py
src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py
+1
-1
No files found.
src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py
View file @
e22b7ced
...
@@ -364,7 +364,7 @@ class GPTBigCodeFlashAttention2(GPTBigCodeAttention):
...
@@ -364,7 +364,7 @@ class GPTBigCodeFlashAttention2(GPTBigCodeAttention):
key
=
key
.
transpose
(
1
,
2
).
reshape
(
batch_size
,
tgt
,
self
.
num_heads
,
self
.
head_dim
)
key
=
key
.
transpose
(
1
,
2
).
reshape
(
batch_size
,
tgt
,
self
.
num_heads
,
self
.
head_dim
)
value
=
value
.
transpose
(
1
,
2
).
reshape
(
batch_size
,
tgt
,
self
.
num_heads
,
self
.
head_dim
)
value
=
value
.
transpose
(
1
,
2
).
reshape
(
batch_size
,
tgt
,
self
.
num_heads
,
self
.
head_dim
)
attn_dropout
=
self
.
drop
out
if
self
.
training
else
0.0
attn_dropout
=
self
.
config
.
attn_p
drop
if
self
.
training
else
0.0
softmax_dtype
=
torch
.
float32
if
self
.
attention_softmax_in_fp32
else
query
.
dtype
softmax_dtype
=
torch
.
float32
if
self
.
attention_softmax_in_fp32
else
query
.
dtype
upcast
=
query
.
dtype
!=
softmax_dtype
upcast
=
query
.
dtype
!=
softmax_dtype
...
...
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