[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 c91165a5a6
commit d43013f14a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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