Skip to content

Commit 1c4809a

Browse files
committed
send partial stop string when <EOG> is reached
1 parent baad948 commit 1c4809a

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
@@ -2319,7 +2319,7 @@ struct server_context {
23192319
slot.generated_text.begin() + pos + stop_pos,
23202320
slot.generated_text.end());
23212321
pos = std::min(slot.n_sent_text, slot.generated_text.size());
2322-
} else if (slot.has_next_token) {
2322+
} else if (slot.has_next_token && !llama_vocab_is_eog(vocab, result.tok) ) {
23232323
stop_pos = slot.find_stopping_strings(str_test, token_str.size(), false);
23242324
send_text = stop_pos == std::string::npos;
23252325
}

0 commit comments

Comments
 (0)