Compare commits

...

2 Commits

Author SHA1 Message Date
Pyry Takala
f5c5f8e055
Merge 81a958350a into 4a87a0d19f 2025-11-22 22:38:29 +01:00
Sofie Van Landeghem
81a958350a
do int conversation before taking the max 2025-11-22 22:38:23 +01:00

View File

@ -117,7 +117,7 @@ def find_last_step(checkpoint_dir):
checkpoint_files = [f for f in os.listdir(checkpoint_dir) if re.search(r'model_(\d+)\.pt$', f)] checkpoint_files = [f for f in os.listdir(checkpoint_dir) if re.search(r'model_(\d+)\.pt$', f)]
if not checkpoint_files: if not checkpoint_files:
raise FileNotFoundError(f"No checkpoints found in {checkpoint_dir}") raise FileNotFoundError(f"No checkpoints found in {checkpoint_dir}")
last_step = int(max(f.split("_")[-1].split(".")[0] for f in checkpoint_files)) last_step = max(int(f.split("_")[-1].split(".")[0]) for f in checkpoint_files)
return last_step return last_step
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------