Fix grammar abort & Minor style fixes (#7204)

This commit is contained in:
Lianmin Zheng
2025-06-14 22:49:41 -07:00
committed by GitHub
parent a6305c7d50
commit 38af4f68a9
8 changed files with 19 additions and 24 deletions

View File

@@ -2108,7 +2108,8 @@ class Scheduler(
# In this case, we change the input_ids to be only one token to make this prefill cheap.
if req.rid.startswith(recv_req.rid):
logger.debug(f"Abort grammar queue request. {req.rid=}")
req.grammar.cancel()
if req.grammar:
req.grammar.cancel()
req.set_finish_with_abort("Aborted by AbortReq.")
# Delete requests in the running batch