Skip to content

[Bug] Old InternVL2 remote-code checkpoints are incompatible with Transformers v5 meta initialization #45092

@baonudesifeizhai

Description

@baonudesifeizhai

System Info

This is relevant to Transformers because the failure is triggered by the Transformers v5 loading path itself.

In v5, from_pretrained() initializes models on the meta device before loading weights. Old OpenGVLab/InternVL2-* remote-code checkpoints perform real-tensor operations during model construction (for example calling .item()), so they fail under the v5 loading mechanism.

From a downstream user's perspective, this happens directly inside AutoModel.from_pretrained(..., trust_remote_code=True), so it is effectively a Transformers compatibility / migration issue, not only a checkpoint-local issue.

This currently blocks vLLM's Transformers v5 upgrade work because the HF reference model for OpenGVLab/InternVL2-1B/2B cannot be instantiated:

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

vllm-project/vllm#38425

Expected behavior

vllm-project/vllm#38425

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions