vocab : warn about missing mask token (#14022)
This commit is contained in:
parent
9e31bec4fd
commit
9f47fa5792
1 changed files with 5 additions and 1 deletions
|
@ -2098,7 +2098,11 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {
|
||||||
|| _contains_any(tokenizer_pre, {"jina-v2-de", "jina-v2-es", "jina-v2-code"})
|
|| _contains_any(tokenizer_pre, {"jina-v2-de", "jina-v2-es", "jina-v2-code"})
|
||||||
|| _contains_any(general_arch, {"nomic-bert-moe"})
|
|| _contains_any(general_arch, {"nomic-bert-moe"})
|
||||||
) {
|
) {
|
||||||
_set_token_attr("<mask>", LLAMA_TOKEN_ATTR_LSTRIP, true);
|
if (token_to_id.count("<mask>") == 0) {
|
||||||
|
LLAMA_LOG_WARN("%s: Mask token is missing in vocab, please reconvert model!\n", __func__);
|
||||||
|
} else {
|
||||||
|
_set_token_attr("<mask>", LLAMA_TOKEN_ATTR_LSTRIP, true);
|
||||||
|
}
|
||||||
} else if (_contains_any(model_name, {"phi-3", "phi3"})) {
|
} else if (_contains_any(model_name, {"phi-3", "phi3"})) {
|
||||||
for (auto id : cache_special_tokens) {
|
for (auto id : cache_special_tokens) {
|
||||||
_set_tokenid_attr(id, LLAMA_TOKEN_ATTR_RSTRIP, true);
|
_set_tokenid_attr(id, LLAMA_TOKEN_ATTR_RSTRIP, true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue