From dd955e575c794fd9e3081b4ffb6e63a1d954deb2 Mon Sep 17 00:00:00 2001 From: diaodeng <108243171+diaodeng@users.noreply.github.com> Date: Thu, 18 Jan 2024 10:55:44 +0800 Subject: Llama2.py result decode error --- g4f/Provider/Llama2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'g4f/Provider') diff --git a/g4f/Provider/Llama2.py b/g4f/Provider/Llama2.py index 6d0c0a44..17969621 100644 --- a/g4f/Provider/Llama2.py +++ b/g4f/Provider/Llama2.py @@ -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" \ No newline at end of file + return "\n".join(messages) + "\n" -- cgit v1.2.3