MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / get_latest_ckpt

Function get_latest_ckpt

train/train_utils.py:26–32  ·  view source on GitHub ↗
(checkpoint_dir)

Source from the content-addressed store, hash-verified

24
25
26def get_latest_ckpt(checkpoint_dir):
27 step_dirs = [d for d in os.listdir(checkpoint_dir) if os.path.isdir(os.path.join(checkpoint_dir, d))]
28 if len(step_dirs) == 0:
29 return None
30 step_dirs = sorted(step_dirs, key=lambda x: int(x))
31 latest_step_dir = os.path.join(checkpoint_dir, step_dirs[-1])
32 return latest_step_dir

Callers 2

mainFunction · 0.90
mainFunction · 0.90

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected