From: Plamen Minev Date: Thu, 5 Dec 2024 21:36:41 +0000 (+0200) Subject: fix(server) : not show alert when DONE is received (#10674) X-Git-Tag: upstream/0.0.4488~213 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=7736837d62efed1dbebfe579472fca041eda12d6;p=pkg%2Fggml%2Fsources%2Fllama.cpp fix(server) : not show alert when DONE is received (#10674) --- diff --git a/examples/server/public_simplechat/simplechat.js b/examples/server/public_simplechat/simplechat.js index 8e0df3b6..2fcd24a8 100644 --- a/examples/server/public_simplechat/simplechat.js +++ b/examples/server/public_simplechat/simplechat.js @@ -407,6 +407,9 @@ class SimpleChat { if (curLine.startsWith("data:")) { curLine = curLine.substring(5); } + if (curLine.trim() === "[DONE]") { + break; + } let curJson = JSON.parse(curLine); console.debug("DBUG:SC:PART:Json:", curJson); this.append_response(this.response_extract_stream(curJson, apiEP));