ignore decode errors.

This commit is contained in:
Wei Kang 2025-06-19 11:30:21 +08:00 committed by GitHub
parent ba5ffc711e
commit 2e1a1af049
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -335,7 +335,7 @@ def main():
byte_list.append(int(token[3:-1], 16))
else:
byte_list += list(token.encode("utf-8"))
text = bytes(byte_list).decode("utf-8")
text = bytes(byte_list).decode("utf-8", errors='ignore')
return text.replace("", " ").strip()
if params.method == "fast_beam_search":