From ddc3848b26a33f3ebaacae5eac1b53e051ae348d Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 30 Jun 2024 22:50:41 +0300 Subject: [PATCH] Fix smooth streaming for 01.AI --- public/scripts/sse-stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/sse-stream.js b/public/scripts/sse-stream.js index 8d7fe9299..c8371b529 100644 --- a/public/scripts/sse-stream.js +++ b/public/scripts/sse-stream.js @@ -160,7 +160,7 @@ async function* parseStreamData(json) { return; } // llama.cpp? - else if (typeof json.content === 'string' && json.content.length > 0) { + else if (typeof json.content === 'string' && json.content.length > 0 && json.object !== 'chat.completion.chunk') { for (let i = 0; i < json.content.length; i++) { const str = json.content[i]; yield {