[Bugfix]Fix search start_index of stop_checker (#13280)

This commit is contained in:
Xu Song
2025-02-15 13:39:42 +08:00
committed by GitHub
parent 9076325677
commit 067fa2255b

View File

@ -113,7 +113,7 @@ class StopChecker:
stop_string_len = len(stop_str)
# Avoid searching already-searched text.
stop_index = output_text.find(stop_str,
-new_char_count - stop_string_len)
1 - new_char_count - stop_string_len)
if stop_index == -1:
continue