From a6070b7c5adc2409e67058ec64d0fb15355c7fdc Mon Sep 17 00:00:00 2001 From: goerch Date: Tue, 19 Sep 2023 21:34:41 +0200 Subject: [PATCH] Fixed vocabulary guarding assertions --- llama.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llama.cpp b/llama.cpp index 569d06e725502..3a9db70491133 100644 --- a/llama.cpp +++ b/llama.cpp @@ -1831,7 +1831,7 @@ static void llm_load_vocab( for (int i = 0; i < n_merges; i++) { const std::string word = gguf_get_arr_str(ctx, merges_keyidx, i); - GGML_ASSERT(codepoints_from_utf8(word).size() >= 0); + GGML_ASSERT(codepoints_from_utf8(word).size() > 0); std::string first; std::string second; @@ -1866,7 +1866,7 @@ static void llm_load_vocab( for (uint32_t i = 0; i < n_vocab; i++) { std::string word = gguf_get_arr_str(ctx, token_idx, i); - GGML_ASSERT(codepoints_from_utf8(word).size() >= 0); + GGML_ASSERT(codepoints_from_utf8(word).size() > 0); vocab.token_to_id[word] = i;