Skip to content

Commit

Permalink
llama: log warning if there's no vocab_size in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Xarbirus committed Sep 16, 2024
1 parent 544b266 commit 9704f0e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9704f0e

Please sign in to comment.