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
18d42bfd
Unverified
Commit
18d42bfd
authored
Jul 17, 2023
by
namespace-Pt
Committed by
GitHub
Jul 17, 2023
Browse files
Remove unused code in GPT-Neo (#24826)
1
parent
9771ad33
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
src/transformers/models/gpt_neo/modeling_gpt_neo.py
src/transformers/models/gpt_neo/modeling_gpt_neo.py
+1
-2
No files found.
src/transformers/models/gpt_neo/modeling_gpt_neo.py
View file @
18d42bfd
...
...
@@ -696,8 +696,7 @@ class GPTNeoForCausalLM(GPTNeoPreTrainedModel):
position_ids
.
masked_fill_
(
attention_mask
==
0
,
1
)
if
past_key_values
:
position_ids
=
position_ids
[:,
-
1
].
unsqueeze
(
-
1
)
else
:
position_ids
=
None
return
{
"input_ids"
:
input_ids
,
"past_key_values"
:
past_key_values
,
...
...
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