Skip to content

Commit 19e5324

Browse files
committed
fix: had to fix up the resume functionality to load from a checkpoint path
1 parent 5146da4 commit 19e5324

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: nemo/lightning/resume.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ def setup(self, trainer: Union[pl.Trainer, fl.Fabric], model=None):
104104
raise NotImplementedError("Fabric is not supported yet.")
105105

106106
trainer_ckpt_path = self.get_trainer_ckpt_path(model)
107+
# Need a way to actually restore the context.
108+
model = _try_restore_tokenizer(model, os.path.join(trainer_ckpt_path.parent, "context"))
109+
107110
if trainer_ckpt_path:
108111
trainer.ckpt_path = trainer_ckpt_path
109112
trainer.checkpoint_callback.last_model_path = trainer_ckpt_path
@@ -270,7 +273,8 @@ def _find_trainer_ckpt_path(self) -> Optional[Path]:
270273
return checkpoint
271274

272275
def get_context_path(self, model: Optional[io.ConnectorMixin] = None) -> Optional[Path]:
273-
checkpoint = None
276+
277+
checkpoint = None # ??? this is totally wrong.
274278
app_state = AppState()
275279
app_state.restore = self.resume_if_exists
276280
if self.resume_if_exists:

0 commit comments

Comments
 (0)