Skip to content

Fix T5GemmaEncoder loading for transformers 5.x composite T5GemmaConfig#13143

Open
DavidBert wants to merge 1 commit intohuggingface:mainfrom
Photoroom:T5GemmaEncoder_loading
Open

Fix T5GemmaEncoder loading for transformers 5.x composite T5GemmaConfig#13143
DavidBert wants to merge 1 commit intohuggingface:mainfrom
Photoroom:T5GemmaEncoder_loading

Conversation

@DavidBert
Copy link
Contributor

What does this PR do?

Fixes PRXPipeline.from_pretrained() failing with transformers 5.x due to T5GemmaConfig being refactored into a composite config.

In transformers 5.x, T5GemmaConfig became a composite config with encoder/decoder sub-configs (T5GemmaModuleConfig). When the PRX pipeline loads the text encoder, from_pretrained passes the composite T5GemmaConfig to T5GemmaEncoder.__init__, which expects flat attributes like attention_dropout that only exist on T5GemmaModuleConfig.

The fix wraps T5GemmaEncoder to extract config.encoder before passing it to the constructor.

Fixes #13142

Before submitting

Who can review?

@yiyixuxu @asomoza

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PRXPipeline.from_pretrained() broken with transformers 5.1.0

1 participant