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
OpenDAS
AutoAWQ
Commits
4d49ae1f
Unverified
Commit
4d49ae1f
authored
Dec 03, 2023
by
Casper
Committed by
GitHub
Dec 03, 2023
Browse files
Fix position ids (#215)
parent
8dbf009b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
awq/utils/fused_utils.py
awq/utils/fused_utils.py
+1
-1
No files found.
awq/utils/fused_utils.py
View file @
4d49ae1f
...
@@ -32,7 +32,7 @@ def prepare_input_ids(input_ids: torch.Tensor, last_forward_num_tokens: int):
...
@@ -32,7 +32,7 @@ def prepare_input_ids(input_ids: torch.Tensor, last_forward_num_tokens: int):
num_new_tokens
=
num_input_tokens
-
last_forward_num_tokens
num_new_tokens
=
num_input_tokens
-
last_forward_num_tokens
# after context is processed, slice to latest token
# after context is processed, slice to latest token
if
num_new_tokens
in
[
0
,
1
]
:
if
num_new_tokens
==
1
:
input_ids
=
input_ids
[:,
-
1
:]
input_ids
=
input_ids
[:,
-
1
:]
return
input_ids
,
last_forward_num_tokens
+
num_new_tokens
return
input_ids
,
last_forward_num_tokens
+
num_new_tokens
...
...
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