Skip to content

Commit

Permalink
Fixed vocabulary guarding assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
goerch committed Sep 19, 2023
1 parent 59a30b7 commit a6070b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit a6070b7

Please sign in to comment.