From 940efa95fec0b8a98c226a889d2ad839dfeeae0d Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Mon, 16 Oct 2023 23:58:00 +0300 Subject: llava : fix tokenization to not add bos between image embeddings and user prompt (#3645) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * llava : fix tokenization to not add bos after system prompt * set seed --------- Co-authored-by: M. Yusuf Sarıgöz --- examples/llava/llava-utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/llava/llava-utils.h') 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 embd_inp = ::llama_tokenize(ctx_llama, str2, true); + std::vector embd_inp = ::llama_tokenize(ctx_llama, str2, add_bos); eval_tokens(ctx_llama, embd_inp, n_batch, n_past); return true; } -- cgit v1.2.3