Skip to content

Gemma3 implementation needs to be updated. #786

@onaka-ga-pkpk

Description

@onaka-ga-pkpk

🚀 The feature, motivation and pitch

The Transformers implementation of Gemma3 has undergone various modifications, but the implementation in this repository does not reflect those changes and does not load Gemma3 properly.
For example, in transformers, the _update_causal_mask is already not used.

https://github.com/huggingface/transformers/blob/e6a8063ef1af16df964b644b07e1d17e96555d23/src/transformers/models/gemma3/modular_gemma3.py#L748-L749

def _update_causal_mask(self, **super_kwargs):
        raise AttributeError("We don't want to inherit it")

causal_mask = self._update_causal_mask(
attention_mask, token_type_ids, past_key_values, cache_position, inputs_embeds, is_training
)

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions