Llama2.py result decode error

This commit is contained in:
diaodeng 2024-01-18 10:55:44 +08:00 committed by GitHub
parent b955620aeb
commit dd955e575c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,7 +62,7 @@ class Llama2(AsyncGeneratorProvider):
if not started:
chunk = chunk.lstrip()
started = True
yield chunk.decode()
yield chunk.decode(errors="ignore")
def format_prompt(messages: Messages):
messages = [
@ -71,4 +71,4 @@ def format_prompt(messages: Messages):
else message["content"]
for message in messages
]
return "\n".join(messages) + "\n"
return "\n".join(messages) + "\n"