]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
fix(server) : not show alert when DONE is received (#10674)
authorPlamen Minev <redacted>
Thu, 5 Dec 2024 21:36:41 +0000 (23:36 +0200)
committerGitHub <redacted>
Thu, 5 Dec 2024 21:36:41 +0000 (22:36 +0100)
examples/server/public_simplechat/simplechat.js

index 8e0df3b61df2b1b279b6419583d2f3dfd6542b0c..2fcd24a860bd4d9130d314cf12604ac9b3b60ea0 100644 (file)
@@ -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));