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
text-generation-inference
Commits
c0795de2
Unverified
Commit
c0795de2
authored
Mar 09, 2023
by
OlivierDehaene
Committed by
GitHub
Mar 09, 2023
Browse files
fix(server): do not warp prefill logits (#116)
parent
1a2d6825
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
server/text_generation_server/utils/tokens.py
server/text_generation_server/utils/tokens.py
+5
-1
No files found.
server/text_generation_server/utils/tokens.py
View file @
c0795de2
...
...
@@ -75,7 +75,11 @@ class NextTokenChooser:
def
__call__
(
self
,
input_ids
,
scores
):
# Warp logits
scores
=
self
.
warpers
(
input_ids
,
scores
)
if
scores
.
shape
[
0
]
>
1
:
# only warp the last token logits
scores
[
-
1
:,
:]
=
self
.
warpers
(
input_ids
,
scores
[
-
1
:,
:])
else
:
scores
=
self
.
warpers
(
input_ids
,
scores
)
# Compute logprobs
logprobs
=
torch
.
log_softmax
(
scores
,
-
1
)
...
...
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