MCPcopy Create free account
hub / github.com/apple/axlearn / latest_checkpoint_path

Method latest_checkpoint_path

axlearn/common/checkpointer.py:839–855  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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]:

Callers 4

restoreMethod · 0.80
test_read_state_specMethod · 0.80

Calls 1

checkpoint_pathsMethod · 0.45

Tested by 3

test_read_state_specMethod · 0.64