mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-23 00:22:09 +03:00
Error checking for Vercel (#1704)
Error checking is done for Vercel's create_completion to avoid interruption caused by UnicodeDecodeError.
This commit is contained in:
parent
f089141108
commit
f41efef0ae
@ -63,7 +63,10 @@ class Vercel(AbstractProvider):
|
||||
if not response.ok:
|
||||
continue
|
||||
for token in response.iter_content(chunk_size=None):
|
||||
yield token.decode()
|
||||
try:
|
||||
yield token.decode()
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
break
|
||||
raise_for_status(response)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user