Skip to content

Commit

Permalink
✏️ Add better deprecation in Trainer.resume_from_checkpoint()
Browse files Browse the repository at this point in the history
  • Loading branch information
arxyzan committed Jun 10, 2024
1 parent d9286c4 commit a4d47ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hezar/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ def _print_info_line(key, value):
# Footer
self.accelerator.print(f"\n{colorize_text(footer, 'bold')}\n")

def train(self, resume_from_checkpoint: str | bool = None):
def train(self, resume_from_checkpoint="deprecated"):
"""
The full training process like training, evaluation, logging and saving model checkpoints.
Expand All @@ -704,7 +704,7 @@ def train(self, resume_from_checkpoint: str | bool = None):
- Save the trainer state
- Write logs to tensorboard, csv, etc.
"""
if resume_from_checkpoint:
if resume_from_checkpoint != "deprecated":
raise ValueError(
"Setting `resume_from_checkpoint` in `Trainer.train(resume_from_checkpoint=...)` is deprecated. "
"You have to set it in the trainer's config!"
Expand Down

0 comments on commit a4d47ab

Please sign in to comment.