Skip to content

Commit

Permalink
vocab : add dummy tokens for "no_vocab" type (ggerganov#11231)
Browse files Browse the repository at this point in the history
* vocab : add dummy tokens for "no_vocab" type

ggml-ci

* vocab : minor [no ci]
  • Loading branch information
ggerganov authored Jan 14, 2025
1 parent c5bf0d1 commit bbf3e55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/llama-vocab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1356,8 +1356,9 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {

// read vocab size from metadata
uint32_t n_tokens = 0;
if (!ml.get_key(LLM_KV_VOCAB_SIZE, n_tokens, false)) {
LLAMA_LOG_WARN("%s: there is no vocab_size in metadata\n", __func__);
if (ml.get_key(LLM_KV_VOCAB_SIZE, n_tokens, false)) {
LLAMA_LOG_WARN("%s: adding %u dummy tokens\n", __func__, n_tokens);
id_to_token.resize(n_tokens);
}

return;
Expand Down

0 comments on commit bbf3e55

Please sign in to comment.