Skip to content

Commit

Permalink
server : fix token duplication when streaming with stop strings (#10997)
Browse files Browse the repository at this point in the history
  • Loading branch information
z80maniac authored Dec 28, 2024
1 parent d79d8f3 commit 16cdce7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 16cdce7

Please sign in to comment.