Fix input logprob index (#9841)
Co-authored-by: Sheng Shen <sheng.s@berkeley.edu>
This commit is contained in:
@@ -93,12 +93,13 @@ class SchedulerOutputProcessorMixin:
|
||||
# This updates radix so others can match
|
||||
self.tree_cache.cache_unfinished_req(req)
|
||||
|
||||
if req.return_logprob:
|
||||
if batch.return_logprob:
|
||||
assert extend_logprob_start_len_per_req is not None
|
||||
assert extend_input_len_per_req is not None
|
||||
extend_logprob_start_len = extend_logprob_start_len_per_req[i]
|
||||
extend_input_len = extend_input_len_per_req[i]
|
||||
num_input_logprobs = extend_input_len - extend_logprob_start_len
|
||||
if req.return_logprob:
|
||||
self.add_logprob_return_values(
|
||||
i,
|
||||
req,
|
||||
@@ -146,7 +147,7 @@ class SchedulerOutputProcessorMixin:
|
||||
skip_stream_req = req
|
||||
|
||||
# Incrementally update input logprobs.
|
||||
if req.return_logprob:
|
||||
if batch.return_logprob:
|
||||
extend_logprob_start_len = extend_logprob_start_len_per_req[i]
|
||||
extend_input_len = extend_input_len_per_req[i]
|
||||
if extend_logprob_start_len < extend_input_len:
|
||||
@@ -154,6 +155,7 @@ class SchedulerOutputProcessorMixin:
|
||||
num_input_logprobs = (
|
||||
extend_input_len - extend_logprob_start_len
|
||||
)
|
||||
if req.return_logprob:
|
||||
self.add_input_logprob_return_values(
|
||||
i,
|
||||
req,
|
||||
|
||||
Reference in New Issue
Block a user