mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-07-10 02:07:08 +08:00
[Frontend] Improve the performance of is_reasoning_end (#25735)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
parent
5bc26c438d
commit
be067861c6
@ -59,7 +59,8 @@ class BaseThinkingReasoningParser(ReasoningParser):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def is_reasoning_end(self, input_ids: list[int]) -> bool:
|
def is_reasoning_end(self, input_ids: list[int]) -> bool:
|
||||||
return self.end_token_id in input_ids
|
end_token_id = self.end_token_id
|
||||||
|
return any(input_id == end_token_id for input_id in reversed(input_ids))
|
||||||
|
|
||||||
def extract_content_ids(self, input_ids: list[int]) -> list[int]:
|
def extract_content_ids(self, input_ids: list[int]) -> list[int]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user