Skip to content

Commit 5409c43

Browse files
matteoservafm240223
authored andcommitted
server : send partial stop string when <EOG> is reached (ggml-org#15007)
1 parent 5301436 commit 5409c43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/server/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2839,7 +2839,7 @@ struct server_context {
28392839
slot.generated_text.begin() + pos + stop_pos,
28402840
slot.generated_text.end());
28412841
pos = std::min(slot.n_sent_text, slot.generated_text.size());
2842-
} else if (slot.has_next_token) {
2842+
} else if (slot.has_next_token && !llama_vocab_is_eog(vocab, result.tok) ) {
28432843
stop_pos = slot.find_stopping_strings(str_test, token_str.size(), false);
28442844
send_text = stop_pos == std::string::npos;
28452845
}

0 commit comments

Comments
 (0)