summaryrefslogtreecommitdiff
path: root/examples/llava/llava-utils.h
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-10-16 23:58:00 +0300
committerGitHub <noreply@github.com>2023-10-16 23:58:00 +0300
commit940efa95fec0b8a98c226a889d2ad839dfeeae0d (patch)
tree0cd85f24724689772837b9a9248f5601c52dd612 /examples/llava/llava-utils.h
parent11bff290458f12f020b588792707f76ec658a27a (diff)
llava : fix tokenization to not add bos between image embeddings and user prompt (#3645)
* llava : fix tokenization to not add bos after system prompt * set seed --------- Co-authored-by: M. Yusuf Sarıgöz <yusufsarigoz@gmail.com>
Diffstat (limited to 'examples/llava/llava-utils.h')
-rw-r--r--examples/llava/llava-utils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/llava/llava-utils.h b/examples/llava/llava-utils.h
index 79e237c8..4e71351d 100644
--- a/examples/llava/llava-utils.h
+++ b/examples/llava/llava-utils.h
@@ -49,9 +49,9 @@ inline bool eval_id(struct llama_context * ctx_llama, int id, int * n_past) {
return eval_tokens(ctx_llama, tokens, 1, n_past);
}
-inline bool eval_string(struct llama_context * ctx_llama, const char* str, int n_batch, int * n_past){
+inline bool eval_string(struct llama_context * ctx_llama, const char* str, int n_batch, int * n_past, bool add_bos){
std::string str2 = str;
- std::vector<llama_token> embd_inp = ::llama_tokenize(ctx_llama, str2, true);
+ std::vector<llama_token> embd_inp = ::llama_tokenize(ctx_llama, str2, add_bos);
eval_tokens(ctx_llama, embd_inp, n_batch, n_past);
return true;
}