From d43013f14a529f8730f714ae143ad66fa44b8b64 Mon Sep 17 00:00:00 2001 From: Kingsley <82590017+Kuangdd01@users.noreply.github.com> Date: Tue, 22 Apr 2025 16:38:05 +0800 Subject: [PATCH] [model] add arch check for InternVL (#7803) --- src/llamafactory/model/patcher.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/llamafactory/model/patcher.py b/src/llamafactory/model/patcher.py index e0418bc1..add6320a 100644 --- a/src/llamafactory/model/patcher.py +++ b/src/llamafactory/model/patcher.py @@ -123,6 +123,12 @@ def patch_config( if getattr(config, "model_type", None) == "kimi_vl" and is_trainable: setattr(config.text_config, "topk_method", "greedy") + if "InternVLChatModel" in getattr(config, "architectures", []): + raise ValueError( + "Please download the internvl models in a Hugging Face–compatible format " + "(for example, https://huggingface.co/OpenGVLab/InternVL3-8B-hf)." + ) + if "LlavaLlamaForCausalLM" in getattr(config, "architectures", []): raise ValueError("Please download llava models with hf-compatible format: https://huggingface.co/llava-hf")