@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / be067861c6
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Frontend] Improve the performance of `is_reasoning_end` (#25735)

[Frontend] Improve the performance of `is_reasoning_end` (#25735) Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>

Chauncey committed Oct 11, 2025 at 10:43 UTC be067861c6ab4df53a45e332caf53c163330290d
1 file changed +2 -1
vllm/reasoning/basic_parsers.py
+2 -1
@@ -59,7 +59,8 @@ class BaseThinkingReasoningParser(ReasoningParser):
59 )
60
61 def is_reasoning_end(self, input_ids: list[int]) -> bool:
62 - return self.end_token_id in input_ids
62 + end_token_id = self.end_token_id
63 + return any(input_id == end_token_id for input_id in reversed(input_ids))
64
65 def extract_content_ids(self, input_ids: list[int]) -> list[int]:
66 """