diff --git a/api/responder.py b/api/responder.py index e515c84..3faaa12 100644 --- a/api/responder.py +++ b/api/responder.py @@ -153,7 +153,7 @@ async def respond( chunk = chunk.decode('utf8').strip() if 'azure' in provider_name: - chunk = chunk.strip().replace('data: ', '') + chunk = chunk.strip().replace('data: ', '', 1) if not chunk or chunk_no == 1: continue diff --git a/checks/client.py b/checks/client.py index 7410c23..f6fe5d1 100644 --- a/checks/client.py +++ b/checks/client.py @@ -100,7 +100,7 @@ async def test_chat_stream_gpt3() -> float: async for chunk in response.aiter_text(): for subchunk in chunk.split('\n\n'): - chunk = subchunk.replace('data: ', '').strip() + chunk = subchunk.replace('data: ', '', 1).strip() if chunk == '[DONE]': break