Unverified Commit 9e0dac1a authored by Liangsheng Yin's avatar Liangsheng Yin Committed by GitHub
Browse files

Fix regex and logprob conflicts when chunked prefilling (#1703)

parent a95d5589
...@@ -789,15 +789,15 @@ class Scheduler: ...@@ -789,15 +789,15 @@ class Scheduler:
elif not batch.decoding_reqs or req not in batch.decoding_reqs: elif not batch.decoding_reqs or req not in batch.decoding_reqs:
self.tree_cache.cache_unfinished_req(req) self.tree_cache.cache_unfinished_req(req)
if req.regex_fsm is not None: if req.regex_fsm is not None:
req.regex_fsm_state = req.regex_fsm.get_next_state( req.regex_fsm_state = req.regex_fsm.get_next_state(
req.regex_fsm_state, next_token_ids[i] req.regex_fsm_state, next_token_ids[i]
) )
if req.return_logprob: if req.return_logprob:
logprob_pt += self.add_logprob_return_values( logprob_pt += self.add_logprob_return_values(
i, req, logprob_pt, next_token_ids, logits_output i, req, logprob_pt, next_token_ids, logits_output
) )
else: # embedding or reward model else: # embedding or reward model
assert batch.extend_num_tokens != 0 assert batch.extend_num_tokens != 0
embeddings, bid = result embeddings, bid = result
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment