Skip to content

Conversation

jbischof
Copy link
Contributor

@jbischof jbischof commented Mar 21, 2023

This fixes an annoying corner case where the backbone property references a _backbone attribute that itself is never initalized.

Initializing this properly allows the base class to set self.backbone = None by default as intended instead of throwing an AttributeError.

We do the same for preprocessor and tokenizer.

@jbischof jbischof requested a review from mattdangerw March 21, 2023 22:11
@jbischof jbischof changed the title Init _backbone and _preprocessor in Task Init _backbone _tokenizer and _preprocessor in Task Mar 21, 2023
@jbischof jbischof changed the title Init _backbone _tokenizer and _preprocessor in Task Init _backbone, _tokenizer and _preprocessor in Task Mar 21, 2023
@mattdangerw mattdangerw self-assigned this Mar 22, 2023
Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jbischof jbischof merged commit e6403d0 into keras-team:master Mar 22, 2023
kanpuriyanawab pushed a commit to kanpuriyanawab/keras-nlp that referenced this pull request Mar 26, 2023
…m#899)

* Init _backbone in Task

* Fix `preprocessor` as well

* format

* Fix `_tokenizer`

* Chain to super() first
kanpuriyanawab pushed a commit to kanpuriyanawab/keras-nlp that referenced this pull request Mar 26, 2023
…m#899)

* Init _backbone in Task

* Fix `preprocessor` as well

* format

* Fix `_tokenizer`

* Chain to super() first
chenmoneygithub pushed a commit to chenmoneygithub/keras-nlp that referenced this pull request Mar 28, 2023
…m#899)

* Init _backbone in Task

* Fix `preprocessor` as well

* format

* Fix `_tokenizer`

* Chain to super() first
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.

2 participants