[model] add arch check for InternVL (#7803)

This commit is contained in:
Kingsley 2025-04-22 16:38:05 +08:00 committed by GitHub
parent 7500e761d3
commit 2a564c25d1

View File

@ -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 Facecompatible 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")