Skip to content

Commit

Permalink
Merge pull request #28 from grok-ai/lucmos-patch-1
Browse files Browse the repository at this point in the history
Fix (again) NNTemplateCore callback
  • Loading branch information
lucmos authored Mar 20, 2023
2 parents a85b98e + 99544f7 commit 992a88e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/nn_core/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ def on_train_end(self, trainer: pl.Trainer, pl_module: pl.LightningModule) -> No
def on_save_checkpoint(
self, trainer: pl.Trainer, pl_module: pl.LightningModule, checkpoint: Dict[str, Any]
) -> None:
if trainer.logger is not None:
if self._is_nnlogger(trainer):
trainer.logger.on_save_checkpoint(trainer=trainer, pl_module=pl_module, checkpoint=checkpoint)
metadata = getattr(trainer.datamodule, "metadata", None)
if metadata is not None:
checkpoint[METADATA_KEY] = metadata
metadata = getattr(trainer.datamodule, "metadata", None)
if metadata is not None:
checkpoint[METADATA_KEY] = metadata

0 comments on commit 992a88e

Please sign in to comment.