Skip to content

Commit

Permalink
llama : the WPM vocabs use the CLS token as BOS
Browse files Browse the repository at this point in the history
ggml-ci
  • Loading branch information
ggerganov committed Dec 21, 2024
1 parent 5cd85b5 commit 9d5c711
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/llama-vocab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ bool llama_token_is_control_impl(const struct llama_vocab & vocab, llama_token t
}

llama_token llama_token_bos_impl(const struct llama_vocab & vocab) {
return vocab.special_bos_id;
return vocab.type != LLAMA_VOCAB_TYPE_WPM ? vocab.special_bos_id : vocab.special_cls_id;
}

llama_token llama_token_eos_impl(const struct llama_vocab & vocab) {
Expand Down

0 comments on commit 9d5c711

Please sign in to comment.