@@ -229,40 +229,40 @@ enum llm_arch {
229229};
230230
231231static const std::map<llm_arch, const char *> LLM_ARCH_NAMES = {
232- { LLM_ARCH_LLAMA, "llama" },
233- { LLM_ARCH_FALCON, "falcon" },
234- { LLM_ARCH_GROK, "grok" },
235- { LLM_ARCH_GPT2, "gpt2" },
236- { LLM_ARCH_GPTJ, "gptj" },
237- { LLM_ARCH_GPTNEOX, "gptneox" },
238- { LLM_ARCH_MPT, "mpt" },
239- { LLM_ARCH_BAICHUAN, "baichuan" },
240- { LLM_ARCH_STARCODER, "starcoder" },
241- { LLM_ARCH_PERSIMMON, "persimmon" },
242- { LLM_ARCH_REFACT, "refact" },
243- { LLM_ARCH_BERT, "bert" },
244- { LLM_ARCH_NOMIC_BERT, "nomic-bert" },
245- { LLM_ARCH_JINA_BERT_V2, "jina-bert-v2"},
246- { LLM_ARCH_BLOOM, "bloom" },
247- { LLM_ARCH_STABLELM, "stablelm" },
248- { LLM_ARCH_QWEN, "qwen" },
249- { LLM_ARCH_QWEN2, "qwen2" },
250- { LLM_ARCH_QWEN2MOE, "qwen2moe" },
251- { LLM_ARCH_PHI2, "phi2" },
252- { LLM_ARCH_PHI3, "phi3" },
253- { LLM_ARCH_PLAMO, "plamo" },
254- { LLM_ARCH_CODESHELL, "codeshell" },
255- { LLM_ARCH_ORION, "orion" },
256- { LLM_ARCH_INTERNLM2, "internlm2" },
257- { LLM_ARCH_MINICPM, "minicpm" },
258- { LLM_ARCH_GEMMA, "gemma" },
259- { LLM_ARCH_STARCODER2, "starcoder2" },
260- { LLM_ARCH_MAMBA, "mamba" },
261- { LLM_ARCH_XVERSE, "xverse" },
262- { LLM_ARCH_COMMAND_R, "command-r" },
263- { LLM_ARCH_DBRX, "dbrx" },
264- { LLM_ARCH_OLMO, "olmo" },
265- { LLM_ARCH_UNKNOWN, "(unknown)" },
232+ { LLM_ARCH_LLAMA, "llama" },
233+ { LLM_ARCH_FALCON, "falcon" },
234+ { LLM_ARCH_GROK, "grok" },
235+ { LLM_ARCH_GPT2, "gpt2" },
236+ { LLM_ARCH_GPTJ, "gptj" },
237+ { LLM_ARCH_GPTNEOX, "gptneox" },
238+ { LLM_ARCH_MPT, "mpt" },
239+ { LLM_ARCH_BAICHUAN, "baichuan" },
240+ { LLM_ARCH_STARCODER, "starcoder" },
241+ { LLM_ARCH_PERSIMMON, "persimmon" },
242+ { LLM_ARCH_REFACT, "refact" },
243+ { LLM_ARCH_BERT, "bert" },
244+ { LLM_ARCH_NOMIC_BERT, "nomic-bert" },
245+ { LLM_ARCH_JINA_BERT_V2, "jina-bert-v2" },
246+ { LLM_ARCH_BLOOM, "bloom" },
247+ { LLM_ARCH_STABLELM, "stablelm" },
248+ { LLM_ARCH_QWEN, "qwen" },
249+ { LLM_ARCH_QWEN2, "qwen2" },
250+ { LLM_ARCH_QWEN2MOE, "qwen2moe" },
251+ { LLM_ARCH_PHI2, "phi2" },
252+ { LLM_ARCH_PHI3, "phi3" },
253+ { LLM_ARCH_PLAMO, "plamo" },
254+ { LLM_ARCH_CODESHELL, "codeshell" },
255+ { LLM_ARCH_ORION, "orion" },
256+ { LLM_ARCH_INTERNLM2, "internlm2" },
257+ { LLM_ARCH_MINICPM, "minicpm" },
258+ { LLM_ARCH_GEMMA, "gemma" },
259+ { LLM_ARCH_STARCODER2, "starcoder2" },
260+ { LLM_ARCH_MAMBA, "mamba" },
261+ { LLM_ARCH_XVERSE, "xverse" },
262+ { LLM_ARCH_COMMAND_R, "command-r" },
263+ { LLM_ARCH_DBRX, "dbrx" },
264+ { LLM_ARCH_OLMO, "olmo" },
265+ { LLM_ARCH_UNKNOWN, "(unknown)" },
266266};
267267
268268enum llm_kv {
@@ -3800,6 +3800,12 @@ static void llm_load_hparams(
38003800
38013801 // get hparams kv
38023802 ml.get_key(LLM_KV_VOCAB_SIZE, hparams.n_vocab, false) || ml.get_arr_n(LLM_KV_TOKENIZER_LIST, hparams.n_vocab);
3803+
3804+ // everything past this point is not vocab-related
3805+ if (hparams.vocab_only) {
3806+ return;
3807+ }
3808+
38033809 ml.get_key(LLM_KV_CONTEXT_LENGTH, hparams.n_ctx_train);
38043810 ml.get_key(LLM_KV_EMBEDDING_LENGTH, hparams.n_embd);
38053811 ml.get_key(LLM_KV_FEED_FORWARD_LENGTH, hparams.n_ff);
@@ -4417,7 +4423,9 @@ static void llm_load_vocab(
44174423 tokenizer_pre == "starcoder") {
44184424 vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_STARCODER;
44194425 } else if (
4420- tokenizer_pre == "gpt-2") {
4426+ tokenizer_pre == "gpt-2" ||
4427+ tokenizer_pre == "jina-es" ||
4428+ tokenizer_pre == "jina-de") {
44214429 vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_GPT2;
44224430 } else if (
44234431 tokenizer_pre == "refact") {
0 commit comments