fix(openai_api_compatible): fixing the error when converting chunk to json (#3570)

This commit is contained in:
aniaan 2024-04-18 16:54:16 +08:00 committed by GitHub
parent 4365843c20
commit aa6d2e3035
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -425,6 +425,7 @@ class OAIAPICompatLargeLanguageModel(_CommonOAI_API_Compat, LargeLanguageModel):
finish_reason = 'Unknown'
for chunk in response.iter_lines(decode_unicode=True, delimiter=delimiter):
chunk = chunk.strip()
if chunk:
# ignore sse comments
if chunk.startswith(':'):