diff options
author | Commenter123321 <36051603+Commenter123321@users.noreply.github.com> | 2023-10-09 20:53:31 +0200 |
---|---|---|
committer | Commenter123321 <36051603+Commenter123321@users.noreply.github.com> | 2023-10-09 20:53:31 +0200 |
commit | 58c45522ea4f94f90c3ebbf350eba0b5715848ae (patch) | |
tree | 4d4a94c33fd41da0f2ab9c325df0f0274aa53c98 /g4f/Provider/DeepAi.py | |
parent | Merge remote-tracking branch 'origin/main' (diff) | |
download | gpt4free-58c45522ea4f94f90c3ebbf350eba0b5715848ae.tar gpt4free-58c45522ea4f94f90c3ebbf350eba0b5715848ae.tar.gz gpt4free-58c45522ea4f94f90c3ebbf350eba0b5715848ae.tar.bz2 gpt4free-58c45522ea4f94f90c3ebbf350eba0b5715848ae.tar.lz gpt4free-58c45522ea4f94f90c3ebbf350eba0b5715848ae.tar.xz gpt4free-58c45522ea4f94f90c3ebbf350eba0b5715848ae.tar.zst gpt4free-58c45522ea4f94f90c3ebbf350eba0b5715848ae.zip |
Diffstat (limited to 'g4f/Provider/DeepAi.py')
-rw-r--r-- | g4f/Provider/DeepAi.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/g4f/Provider/DeepAi.py b/g4f/Provider/DeepAi.py index bac3e3fe..9a4f922c 100644 --- a/g4f/Provider/DeepAi.py +++ b/g4f/Provider/DeepAi.py @@ -65,7 +65,10 @@ f = function () { response.raise_for_status() async for stream in response.content.iter_any(): if stream: - yield stream.decode() + try: + yield stream.decode("utf-8") + except UnicodeDecodeError: + yield stream.decode("unicode-escape") def get_api_key(user_agent: str): |