diff --git a/modules/text_generation.py b/modules/text_generation.py index eff6495e..cbe5b61b 100644 --- a/modules/text_generation.py +++ b/modules/text_generation.py @@ -444,7 +444,7 @@ def generate_reply_HF(question, original_question, seed, state, stopping_strings new_content = get_reply_from_output_ids(output, state, starting_from=starting_from) # check the partial unicode character - if chr(0xfffd) in new_content: + if new_content.endswith(chr(0xfffd)): continue cumulative_reply += new_content