Skip to content

Commit ca53987

Browse files
z80maniacmglambda
authored andcommitted
server : fix token duplication when streaming with stop strings (ggml-org#10997)
1 parent 0734b2f commit ca53987

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/server/server.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,8 @@ struct server_context {
18561856
result.text_to_send = slot.generated_text.substr(pos, std::string::npos);
18571857
slot.n_sent_text += result.text_to_send.size();
18581858
// add the token to slot queue and cache
1859+
} else {
1860+
result.text_to_send = "";
18591861
}
18601862

18611863
slot.add_token(result);

0 commit comments

Comments
 (0)