mirror of
https://github.com/lanqian528/chat2api.git
synced 2026-06-16 21:10:55 +08:00
Merge pull request #25 from yuanzhanghu/main
fixed json parsing error for ping result in stream
This commit is contained in:
commit
2e79b88b81
@ -103,7 +103,7 @@ async def stream_response(service, response, model, max_tokens):
|
||||
try:
|
||||
if chunk.startswith("data: [DONE]"):
|
||||
yield "data: [DONE]\n\n"
|
||||
elif not chunk.startswith("data: "):
|
||||
elif not chunk.startswith("data: {"):
|
||||
continue
|
||||
else:
|
||||
chunk_old_data = json.loads(chunk[6:])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user