From: Alexey Parfenov Date: Sat, 28 Dec 2024 15:08:54 +0000 (+0000) Subject: server : fix token duplication when streaming with stop strings (#10997) X-Git-Tag: upstream/0.0.4488~94 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=16cdce7b68218959e0658e2f95b4572573d5008e;p=pkg%2Fggml%2Fsources%2Fllama.cpp server : fix token duplication when streaming with stop strings (#10997) --- diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 30ff3b14..3558ddb7 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -1856,6 +1856,8 @@ struct server_context { result.text_to_send = slot.generated_text.substr(pos, std::string::npos); slot.n_sent_text += result.text_to_send.size(); // add the token to slot queue and cache + } else { + result.text_to_send = ""; } slot.add_token(result);