diff --git a/llama.cpp b/llama.cpp index 99e0dd98807da4..c36c8592254e38 100644 --- a/llama.cpp +++ b/llama.cpp @@ -216,7 +216,7 @@ static std::map LLM_ARCH_NAMES = { { LLM_ARCH_BLOOM, "bloom" }, { LLM_ARCH_STABLELM, "stablelm" }, { LLM_ARCH_QWEN, "qwen" }, - { LLM_ARCH_PHI, "phi" }, + { LLM_ARCH_PHI, "phi" }, { LLM_ARCH_PLAMO, "plamo" }, }; @@ -2119,6 +2119,13 @@ struct llama_model_loader { } get_key(llm_kv(LLM_KV_GENERAL_ARCHITECTURE), arch_name, false); + + // backwards compatibility with pre-#4552 + // TODO: remove after Mar 2024 + if (arch_name == "phi2") { + arch_name = "phi"; + } + llm_kv = LLM_KV(llm_arch_from_string(arch_name)); n_kv = gguf_get_n_kv(ctx_gguf);