Returns the most recent (highest step count) complete checkpoint under base dir. Args: base_dir: Path to checkpoints dir. Returns: The path to the checkpoint directory under base_dir with the highest step count. The checkpoint is guaranteed to be
(cls, base_dir: str)
| 837 | |
| 838 | @classmethod |
| 839 | def latest_checkpoint_path(cls, base_dir: str) -> str: |
| 840 | """Returns the most recent (highest step count) complete checkpoint under base dir. |
| 841 | |
| 842 | Args: |
| 843 | base_dir: Path to checkpoints dir. |
| 844 | |
| 845 | Returns: |
| 846 | The path to the checkpoint directory under base_dir with the highest step count. |
| 847 | The checkpoint is guaranteed to be complete. |
| 848 | """ |
| 849 | logging.log_first_n( |
| 850 | logging.WARNING, |
| 851 | msg="latest_checkpoint_path is deprecated. Use latest_checkpoint_step instead.", |
| 852 | n=1, |
| 853 | ) |
| 854 | # Note: checkpoint_paths should already filter incomplete checkpoints. |
| 855 | return sorted(cls.checkpoint_paths(base_dir)).pop() |
| 856 | |
| 857 | @classmethod |
| 858 | def checkpoint_steps(cls, base_dir: str) -> list[int]: |