Refine logprob logic for request handling (#17986)
This commit is contained in:
@@ -1545,8 +1545,9 @@ class Scheduler(
|
|||||||
recv_req.logprob_start_len = -1
|
recv_req.logprob_start_len = -1
|
||||||
|
|
||||||
if recv_req.logprob_start_len == -1:
|
if recv_req.logprob_start_len == -1:
|
||||||
if recv_req.return_logprob:
|
if recv_req.return_logprob and recv_req.token_ids_logprob is None:
|
||||||
# If return_logprob is True, return the logprobs for output tokens by default
|
# If logprob is required but neither token_ids_logprob nor logprob_start_len is
|
||||||
|
# set, return the logprobs for output tokens by default
|
||||||
req.logprob_start_len = len(req.origin_input_ids) - 1
|
req.logprob_start_len = len(req.origin_input_ids) - 1
|
||||||
elif req.is_prefill_only:
|
elif req.is_prefill_only:
|
||||||
# For prefill-only requests with logprob_start_len == -1, set logprob_start_len
|
# For prefill-only requests with logprob_start_len == -1, set logprob_start_len
|
||||||
|
|||||||
Reference in New Issue
Block a user