From 9704f0e92822696a3652b8907eafbb654937c872 Mon Sep 17 00:00:00 2001 From: Michael Podvitskiy Date: Mon, 16 Sep 2024 19:30:07 +0200 Subject: [PATCH] llama: log warning if there's no vocab_size in metadata --- src/llama.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/llama.cpp b/src/llama.cpp index 64074efdf5c51..d7855717a19ef 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -6062,8 +6062,9 @@ static void llm_load_vocab( vocab.linefeed_id = -1; // read vocab size from metadata - ml.get_key(LLM_KV_VOCAB_SIZE, vocab.n_vocab); - + if (!ml.get_key(LLM_KV_VOCAB_SIZE, vocab.n_vocab, false)) { + LLAMA_LOG_WARN("%s: there is no vocab_size in metadata, vocab.n_vocab will be set to 0\n", __func__); + } return; }