diff --git a/api/responder.py b/api/responder.py index 7b6f6a8..a19c4df 100644 --- a/api/responder.py +++ b/api/responder.py @@ -151,7 +151,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 'prompt_filter_results' in chunk: continue diff --git a/checks/client.py b/checks/client.py index a149377..e7a8ebe 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