-
Notifications
You must be signed in to change notification settings - Fork 31.2k
Fix missing num_hidden_layers attribute in T5GemmaConfig #40903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missing num_hidden_layers attribute in T5GemmaConfig #40903
Conversation
This is a quick fix for issue huggingface#40874. The `T5GemmaConfig` class was missing the `num_hidden_layers` attribute that cache initialization expects. Added `attribute_map` and `num_layers` property following the same pattern used by `T5Config` to expose the decoder's `num_hidden_layers` value.
This is a quick fix for issue huggingface#40874. The `T5GemmaConfig` class was missing the `num_hidden_layers` attribute that cache initialization expects. Added `attribute_map` and `num_layers` property following the same pattern used by `T5Config` to expose the decoder's `num_hidden_layers` value.
ArthurZucker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot that it was an encoder decoder hahah there might be a better way to fix this @gante I don't remember what we do in that case
This is a quick fix for issue huggingface#40874. The `T5GemmaConfig.get_text_config()` method was always returning self instead of the appropriate sub-configuration. This caused cache initialization failures because the main config lacks `num_hidden_layers` while the decoder/encoder sub-configs have this attribute. Now the method correctly returns the decoder config when `decoder=True` and encoder config when `encoder=True`, allowing `cache_utils.py` to obtain the proper configuration with `num_hidden_layers` for cache initialization.
…_T5GemmaConfig' into fix_missing_num_hidden_layers_in_T5GemmaConfig # Conflicts: # src/transformers/models/t5gemma/configuration_t5gemma.py
This is a quick fix for issue huggingface#40874. The `T5GemmaConfig` class was missing the `num_hidden_layers` attribute that cache initialization expects. Added `num_hidden_layers` property to expose the decoder's `num_hidden_layers` value.
This is a quick fix for issue huggingface#40874. The `T5GemmaConfig` class was missing the `num_hidden_layers` attribute that cache initialization expects. Added `num_hidden_layers` property to expose the decoder's `num_hidden_layers` value.
|
[For maintainers] Suggested jobs to run (before merge) run-slow: t5gemma |
gante
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhmmm this is not wanted, it means config.get_text_config is not fetching the decoder for this model correctly. Having a look at the original issue
|
#40939 is the right fix 🤗 In any case, thank you for being proactive and trying to fix the issue 🫶 |
|
(closing the PR so we don't mistakenly merge it) |
This is a quick fix for issue #40874. The
T5GemmaConfigclass was missing thenum_hidden_layersattribute that cache initialization expects. Addednum_hidden_layersproperty to expose the decoder'snum_hidden_layersvalue.What does this PR do?
Fixes #40874
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.