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
gaoqiong
flash-attention
Commits
7b33743a
Commit
7b33743a
authored
Sep 03, 2023
by
Tri Dao
Browse files
[Gen] Add back num_last_tokens in gpt.py
parent
5953c4f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
flash_attn/models/gpt.py
flash_attn/models/gpt.py
+2
-0
No files found.
flash_attn/models/gpt.py
View file @
7b33743a
...
...
@@ -634,6 +634,8 @@ class GPTLMHeadModel(GPTPreTrainedModel, GenerationMixin):
input_ids
,
position_ids
=
position_ids
,
inference_params
=
inference_params
)
assert
hidden_states
.
ndim
==
3
,
"sequence_parallel is not supported in generation mode"
if
num_last_tokens
>
0
:
hidden_states
=
hidden_states
[:,
-
num_last_tokens
:]
if
self
.
project_out
is
not
None
:
hidden_states
=
self
.
project_out
(
hidden_states
)
lm_logits
=
self
.
lm_head
(
hidden_states
)
...
...
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