Skip to content

Commit

Permalink
Fix opt get_config to chain to super
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdangerw committed Dec 6, 2023
1 parent 24a70ba commit f1822bb
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions keras_nlp/models/opt/opt_backbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,19 @@ def __init__(
self.token_embedding = embedding_layer.token_embedding

def get_config(self):
return {
"vocabulary_size": self.vocabulary_size,
"num_layers": self.num_layers,
"num_heads": self.num_heads,
"hidden_dim": self.hidden_dim,
"intermediate_dim": self.intermediate_dim,
"dropout": self.dropout,
"max_sequence_length": self.max_sequence_length,
}
config = super().get_config()
config.update(
{
"vocabulary_size": self.vocabulary_size,
"num_layers": self.num_layers,
"num_heads": self.num_heads,
"hidden_dim": self.hidden_dim,
"intermediate_dim": self.intermediate_dim,
"dropout": self.dropout,
"max_sequence_length": self.max_sequence_length,
}
)
return config

@classproperty
def presets(cls):
Expand Down

0 comments on commit f1822bb

Please sign in to comment.