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
f00bceab
Unverified
Commit
f00bceab
authored
Oct 21, 2021
by
stalkermustang
Committed by
GitHub
Oct 21, 2021
Browse files
Fix typo in comment (#14102)
parent
234cfefb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/gpt2/modeling_gpt2.py
src/transformers/models/gpt2/modeling_gpt2.py
+1
-1
No files found.
src/transformers/models/gpt2/modeling_gpt2.py
View file @
f00bceab
...
@@ -808,7 +808,7 @@ class GPT2Model(GPT2PreTrainedModel):
...
@@ -808,7 +808,7 @@ class GPT2Model(GPT2PreTrainedModel):
attention_mask
=
attention_mask
.
to
(
dtype
=
self
.
dtype
)
# fp16 compatibility
attention_mask
=
attention_mask
.
to
(
dtype
=
self
.
dtype
)
# fp16 compatibility
attention_mask
=
(
1.0
-
attention_mask
)
*
-
10000.0
attention_mask
=
(
1.0
-
attention_mask
)
*
-
10000.0
# If a 2D o
u
3D attention mask is provided for the cross-attention
# If a 2D o
r
3D attention mask is provided for the cross-attention
# we need to make broadcastable to [batch_size, num_heads, seq_length, seq_length]
# we need to make broadcastable to [batch_size, num_heads, seq_length, seq_length]
if
self
.
config
.
add_cross_attention
and
encoder_hidden_states
is
not
None
:
if
self
.
config
.
add_cross_attention
and
encoder_hidden_states
is
not
None
:
encoder_batch_size
,
encoder_sequence_length
,
_
=
encoder_hidden_states
.
size
()
encoder_batch_size
,
encoder_sequence_length
,
_
=
encoder_hidden_states
.
size
()
...
...
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