We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 343be7f commit d8bc930Copy full SHA for d8bc930
examples/server/server.cpp
@@ -1322,10 +1322,13 @@ int main(int argc, char **argv)
1322
1323
while (llama.has_next_token) {
1324
const completion_token_output token_with_probs = llama.doCompletion();
1325
- const std::string token_text = token_with_probs.tok == -1 ? "" : llama_token_to_str(llama.ctx, token_with_probs.tok);
1326
- if (llama.multibyte_pending > 0) {
+ if (
+ token_with_probs.tok == -1 ||
1327
+ sent_count == llama.generated_text.size()
1328
+ ) {
1329
continue;
1330
}
1331
+ const std::string token_text = llama_token_to_str(llama.ctx, token_with_probs.tok);
1332
1333
size_t pos = std::min(sent_count, llama.generated_text.size());
1334
0 commit comments