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
Lmdeploy
Commits
64c39dd8
You need to sign in or sign up before continuing.
Unverified
Commit
64c39dd8
authored
Sep 13, 2023
by
WRH
Committed by
GitHub
Sep 13, 2023
Browse files
fix output[-1] when output is empty (#405)
parent
2537c5ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
lmdeploy/turbomind/turbomind.py
lmdeploy/turbomind/turbomind.py
+1
-1
No files found.
lmdeploy/turbomind/turbomind.py
View file @
64c39dd8
...
@@ -344,7 +344,7 @@ class TurboMindInstance:
...
@@ -344,7 +344,7 @@ class TurboMindInstance:
outputs
=
[]
outputs
=
[]
for
output
,
len_
in
zip
(
output_ids
,
sequence_length
):
for
output
,
len_
in
zip
(
output_ids
,
sequence_length
):
output
,
len_
=
output
,
len_
.
item
()
output
,
len_
=
output
,
len_
.
item
()
if
output
[
-
1
].
item
()
==
self
.
eos_id
:
if
len
(
output
)
>
0
and
output
[
-
1
].
item
()
==
self
.
eos_id
:
outputs
.
append
((
output
[:
-
1
],
len_
-
1
))
outputs
.
append
((
output
[:
-
1
],
len_
-
1
))
else
:
else
:
outputs
.
append
((
output
,
len_
))
outputs
.
append
((
output
,
len_
))
...
...
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