def get_checkpoints():
    """Get sorted list of checkpoints based on step number"""
    checkpoints = []
    for dir_name in os.listdir(DATA_DIR):
        if dir_name.startswith(CHECKPOINT_PREFIX):
            try:
                step = int(dir_name.split("_")[-1])
                checkpoints.append((step, dir_name))
            except ValueError:
                continue
    checkpoints.sort(key=lambda x: x[0])
    return [c[1] for c in checkpoints]
Get sorted list of checkpoints based on step number
examples/simplelr_math_eval/visualizer.py