Skip to content

[Bug]: AttributeError: 'Gemma3Config' object has no attribute 'sliding_window' #24846

@rshakoor

Description

@rshakoor

transformers version 4.55.0

🐛 Describe the bug

https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/models/gemma3_mm.py#L691

In the following logic:

if (sliding_window := self.config.sliding_window) is not None:
If the attribute sliding_window does not exist in the config object (and it doesn't exist for Gemma3Config see https://github.com/huggingface/transformers/blob/main/src/transformers/models/gemma3/configuration_gemma3.py#L246), this will raise an AttributeError.

Suggested fix :

Replace the line with a safer getattr() call that handles missing attributes gracefully:

self.sliding_window = getattr(self.config, "sliding_window", None)

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions