hiyouga/LlamaFactory · error · ValueError

Please download the internvl models in a Hugging Face–compat

Error message

Please download the internvl models in a Hugging Face–compatible format (for example, https://huggingface.co/OpenGVLab/InternVL3-8B-hf).

What it means

Error "Please download the internvl models in a Hugging Face–compatible format (for example, https://huggingface.co/OpenGVLab/InternVL3-8B-hf)." thrown in hiyouga/LlamaFactory.

Source

Thrown at src/llamafactory/model/patcher.py:404

    configure_visual_model(config)
    configure_kv_cache(config, model_args, is_trainable)

    if getattr(config, "model_type", None) == "qwen":
        setattr(config, "use_flash_attn", model_args.flash_attn == "fa2")
        for dtype_name, dtype in [("fp16", torch.float16), ("bf16", torch.bfloat16), ("fp32", torch.float32)]:
            setattr(config, dtype_name, model_args.compute_dtype == dtype)

    if getattr(config, "model_type", None) == "minicpmo":
        setattr(config, "init_audio", True)
        setattr(config, "init_tts", False)

    # replace the top-k gating method
    if getattr(config, "model_type", None) == "kimi_vl" and is_trainable:
        setattr(config.text_config, "topk_method", "greedy")

    architectures = getattr(config, "architectures", None)
    if isinstance(architectures, list) and "InternVLChatModel" in architectures:
        raise ValueError(
            "Please download the internvl models in a Hugging Face–compatible format "
            "(for example, https://huggingface.co/OpenGVLab/InternVL3-8B-hf)."
        )

    if isinstance(architectures, list) and "LlavaLlamaForCausalLM" in architectures:
        raise ValueError("Please download llava models with hf-compatible format: https://huggingface.co/llava-hf")

    if getattr(config, "model_type", None) == "internlm3" and not is_transformers_version_greater_than("4.47.1"):
        raise RuntimeError("InternLM3 model requires transformers>=4.47.1, please upgrade it.")

    if getattr(config, "model_type", None) == "lfm2_vl" and not is_transformers_version_greater_than("4.58.0"):
        raise RuntimeError(
            "LFM2.5-VL model requires transformers>=4.58.0 or install from commit: "
            "pip install git+https://github.com/huggingface/transformers.git@3c2517727ce28a30f5044e01663ee204deb1cdbe"
        )

    if getattr(config, "model_type", None) == "moss_vl":
        check_version("transformers==4.57.1", mandatory=True)

View on GitHub (pinned to f28afaf635)

Solutions

  1. Download an InternVL checkpoint in Hugging Face-compatible format, e.g. OpenGVLab/InternVL3-8B-hf, and set model_name_or_path to it.

Example fix

model_name_or_path: OpenGVLab/InternVL3-8B-hf

When it happens

Trigger: Thrown at src/llamafactory/model/patcher.py:404 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hiyouga/LlamaFactory@f28afaf635 (2026-08-14). Data as JSON: /api/errors/e79923b1730a4925. Report an issue: GitHub.