From 949c22893411e37267819982cd291706e4076ba6 Mon Sep 17 00:00:00 2001 From: Xu Song Date: Fri, 14 Feb 2025 18:31:02 +0800 Subject: [PATCH 1/3] Fix find_index of stop_checker Signed-off-by: Xu Song --- vllm/engine/output_processor/stop_checker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vllm/engine/output_processor/stop_checker.py b/vllm/engine/output_processor/stop_checker.py index 3bca0bee35a4..4f046b15d688 100644 --- a/vllm/engine/output_processor/stop_checker.py +++ b/vllm/engine/output_processor/stop_checker.py @@ -112,8 +112,8 @@ def check_stop_strings( for stop_str in stop: stop_string_len = len(stop_str) # Avoid searching already-searched text. - stop_index = output_text.find(stop_str, - -new_char_count - stop_string_len) + stop_index = output_text.find(stop_str, + len(output_text) - new_char_count - stop_string_len + 1) if stop_index == -1: continue From 2414c63c255b2426ec60fb77d881de78aa6aa66b Mon Sep 17 00:00:00 2001 From: Xu Song Date: Sat, 15 Feb 2025 09:37:41 +0800 Subject: [PATCH 2/3] Update stop_checker.py Signed-off-by: Xu Song --- vllm/engine/output_processor/stop_checker.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vllm/engine/output_processor/stop_checker.py b/vllm/engine/output_processor/stop_checker.py index 4f046b15d688..699827869569 100644 --- a/vllm/engine/output_processor/stop_checker.py +++ b/vllm/engine/output_processor/stop_checker.py @@ -112,8 +112,7 @@ def check_stop_strings( for stop_str in stop: stop_string_len = len(stop_str) # Avoid searching already-searched text. - stop_index = output_text.find(stop_str, - len(output_text) - new_char_count - stop_string_len + 1) + stop_index = output_text.find(stop_str, 1 - new_char_count - stop_string_len) if stop_index == -1: continue From 642df4eee19ad46be87ab6cc00260dbda76adf86 Mon Sep 17 00:00:00 2001 From: Xu Song Date: Sat, 15 Feb 2025 10:10:05 +0800 Subject: [PATCH 3/3] fix yapf Signed-off-by: Xu Song --- vllm/engine/output_processor/stop_checker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm/engine/output_processor/stop_checker.py b/vllm/engine/output_processor/stop_checker.py index 699827869569..6cad9ec8f327 100644 --- a/vllm/engine/output_processor/stop_checker.py +++ b/vllm/engine/output_processor/stop_checker.py @@ -112,7 +112,8 @@ def check_stop_strings( for stop_str in stop: stop_string_len = len(stop_str) # Avoid searching already-searched text. - stop_index = output_text.find(stop_str, 1 - new_char_count - stop_string_len) + stop_index = output_text.find(stop_str, + 1 - new_char_count - stop_string_len) if stop_index == -1: continue