Fixed vocabulary guarding assertions

This commit is contained in:
goerch 2023-09-19 21:34:41 +02:00
parent 59a30b768a
commit a6070b7c5a

View file

@ -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;