fix detection of stopping strings when HTML escaping is used (#4728)

This commit is contained in:
tsukanov-as 2023-11-27 21:42:08 +03:00 committed by GitHub
parent d06ce7b75c
commit 9f7ae6bb2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,10 +78,9 @@ def _generate_reply(question, state, stopping_strings=None, is_chat=False, escap
# Generate # Generate
for reply in generate_func(question, original_question, seed, state, stopping_strings, is_chat=is_chat): 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: if escape_html:
reply = html.escape(reply) reply = html.escape(reply)
reply, stop_found = apply_stopping_strings(reply, all_stop_strings)
if is_stream: if is_stream:
cur_time = time.time() cur_time = time.time()