Skip to content

Commit 9704f0e

Browse files
committed
llama: log warning if there's no vocab_size in metadata
1 parent 544b266 commit 9704f0e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/llama.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6062,8 +6062,9 @@ static void llm_load_vocab(
60626062
vocab.linefeed_id = -1;
60636063

60646064
// read vocab size from metadata
6065-
ml.get_key(LLM_KV_VOCAB_SIZE, vocab.n_vocab);
6066-
6065+
if (!ml.get_key(LLM_KV_VOCAB_SIZE, vocab.n_vocab, false)) {
6066+
LLAMA_LOG_WARN("%s: there is no vocab_size in metadata, vocab.n_vocab will be set to 0\n", __func__);
6067+
}
60676068
return;
60686069
}
60696070

0 commit comments

Comments
 (0)