]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : remove "first token must be BOS" restriction (#2153)
authoroobabooga <redacted>
Sun, 9 Jul 2023 08:59:53 +0000 (05:59 -0300)
committerGitHub <redacted>
Sun, 9 Jul 2023 08:59:53 +0000 (11:59 +0300)
llama.cpp

index ee6ec0920fc9c8e3d846ec1c93c7914d87910f6e..a491f1c7e15c4d8e5a1c161fa06eb0e5322491d7 100644 (file)
--- a/llama.cpp
+++ b/llama.cpp
@@ -1291,12 +1291,6 @@ static bool llama_eval_internal(
 
     LLAMA_ASSERT((!tokens && embd) || (tokens && !embd));
 
-    // enforce that the first token is BOS
-    if (tokens && n_past == 0 && tokens[0] != llama_token_bos()) {
-        fprintf(stderr, "%s: first token must be BOS\n", __func__);
-        return false;
-    }
-
     const int64_t t_start_us = ggml_time_us();
 
     const int N = n_tokens;