diff --git a/src/llama-vocab.cpp b/src/llama-vocab.cpp index 749f8571829dfc..146fccf04ef6e0 100644 --- a/src/llama-vocab.cpp +++ b/src/llama-vocab.cpp @@ -207,7 +207,8 @@ struct llm_tokenizer_spm { } // seed the work queue with all possible 2-character tokens. - for (size_t i = 1; i < symbols.size(); ++i) { + int symbols_size = static_cast(symbols.size()); + for (int i = 1; i < symbols_size; ++i) { try_add_bigram(i - 1, i); } @@ -511,7 +512,8 @@ struct llm_tokenizer_bpe { index++; symbols.emplace_back(sym); } - for (size_t i = 1; i < symbols.size(); ++i) { + int symbols_size = static_cast(symbols.size()); + for (int i = 1; i < symbols.size(); ++i) { add_new_bigram(i - 1, i); }