Skip to content

Commit b634f8a

Browse files
authored
simple-chat : only add bos on first prompt (#10129)
1 parent 7554aa4 commit b634f8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/simple-chat/simple-chat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ int main(int argc, char ** argv) {
9696
// tokenize the prompt
9797
const int n_prompt_tokens = -llama_tokenize(model, prompt.c_str(), prompt.size(), NULL, 0, true, true);
9898
std::vector<llama_token> prompt_tokens(n_prompt_tokens);
99-
if (llama_tokenize(model, prompt.c_str(), prompt.size(), prompt_tokens.data(), prompt_tokens.size(), true, true) < 0) {
99+
if (llama_tokenize(model, prompt.c_str(), prompt.size(), prompt_tokens.data(), prompt_tokens.size(), llama_get_kv_cache_used_cells(ctx) == 0, true) < 0) {
100100
GGML_ABORT("failed to tokenize the prompt\n");
101101
}
102102

0 commit comments

Comments
 (0)