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()