Skip to content

Qwen3-VL can't be loaded in transformers dev: AttributeError: 'Qwen3VLTextConfig' object has no attribute 'pad_token_id' #43334

@albertvillanova

Description

@albertvillanova

Qwen3-VL can't be loaded in transformers dev branch (5.0.0.dev0 at commit 24807bf):

AttributeError: 'Qwen3VLTextConfig' object has no attribute 'pad_token_id'

After investigation, the issue appeared after the merge of this PR:

As @zucchini-nlp pointed out, there are no slow tests for qwen3VL, which could have prevented this.

See related issue in TRL:

Reproduction

from transformers import AutoModel

AutoModel.from_pretrained('Qwen/Qwen3-VL-2B-Instruct')

Traceback:

  File "<string>", line 1, in <module>
  File "transformers/src/transformers/models/auto/auto_factory.py", line 372, in from_pretrained
    return model_class.from_pretrained(
  File "transformers/src/transformers/modeling_utils.py", line 4020, in from_pretrained
    model = cls(config, *model_args, **model_kwargs)
  File "transformers/src/transformers/models/qwen3_vl/modeling_qwen3_vl.py", line 938, in __init__
    self.language_model = Qwen3VLTextModel._from_config(config.text_config)
  File "transformers/src/transformers/modeling_utils.py", line 1464, in _from_config
    model = cls(config, **kwargs)
  File "transformers/src/transformers/models/qwen3_vl/modeling_qwen3_vl.py", line 807, in __init__
    self.padding_idx = config.pad_token_id
  File "transformers/src/transformers/configuration_utils.py", line 164, in __getattribute__
    return super().__getattribute__(key)
AttributeError: 'Qwen3VLTextConfig' object has no attribute 'pad_token_id'. Did you mean: 'bos_token_id'?

Who can help?

@zucchini-nlp, who created the PR

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