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:
Abobo 2024-03-15 20:30:15 +08:00 committed by GitHub
parent f089141108
commit f41efef0ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)