File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Original file line number Diff line number Diff line change @@ -2098,7 +2098,11 @@ void llama_vocab::impl::load(llama_model_loader & ml, const LLM_KV & kv) {
2098
2098
|| _contains_any (tokenizer_pre, {" jina-v2-de" , " jina-v2-es" , " jina-v2-code" })
2099
2099
|| _contains_any (general_arch, {" nomic-bert-moe" })
2100
2100
) {
2101
- _set_token_attr (" <mask>" , LLAMA_TOKEN_ATTR_LSTRIP, true );
2101
+ if (token_to_id.count (" <mask>" ) == 0 ) {
2102
+ LLAMA_LOG_WARN (" %s: Mask token is missing in vocab, please reconvert model!\n " , __func__);
2103
+ } else {
2104
+ _set_token_attr (" <mask>" , LLAMA_TOKEN_ATTR_LSTRIP, true );
2105
+ }
2102
2106
} else if (_contains_any (model_name, {" phi-3" , " phi3" })) {
2103
2107
for (auto id : cache_special_tokens) {
2104
2108
_set_tokenid_attr (id, LLAMA_TOKEN_ATTR_RSTRIP, true );
You can’t perform that action at this time.
0 commit comments