From 9f7ae6bb2e5d090441cd176de9807da2a678307a Mon Sep 17 00:00:00 2001 From: tsukanov-as Date: Mon, 27 Nov 2023 21:42:08 +0300 Subject: [PATCH] fix detection of stopping strings when HTML escaping is used (#4728) --- modules/text_generation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/text_generation.py b/modules/text_generation.py index 6034ef31..3a4c55b3 100644 --- a/modules/text_generation.py +++ b/modules/text_generation.py @@ -78,10 +78,9 @@ def _generate_reply(question, state, stopping_strings=None, is_chat=False, escap # Generate for reply in generate_func(question, original_question, seed, state, stopping_strings, is_chat=is_chat): + reply, stop_found = apply_stopping_strings(reply, all_stop_strings) if escape_html: reply = html.escape(reply) - - reply, stop_found = apply_stopping_strings(reply, all_stop_strings) if is_stream: cur_time = time.time()