From b74444625ce68bbbfcc380cac3c8af0aa024b924 Mon Sep 17 00:00:00 2001 From: Tsvika Shapira Date: Sat, 27 Dec 2025 16:44:46 +0200 Subject: [PATCH] replace f.name.split('.')[0] with f.stem Co-authored-by: Sofie Van Landeghem --- nanochat/checkpoint_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanochat/checkpoint_manager.py b/nanochat/checkpoint_manager.py index 751436f..72a8f8e 100644 --- a/nanochat/checkpoint_manager.py +++ b/nanochat/checkpoint_manager.py @@ -119,7 +119,7 @@ def find_last_step(checkpoint_dir): checkpoint_files = list(checkpoint_dir.glob("model_*.pt")) if not checkpoint_files: raise FileNotFoundError(f"No checkpoints found in {checkpoint_dir}") - last_step = int(max(f.name.split("_")[-1].split(".")[0] for f in checkpoint_files)) + last_step = int(max(f.stem.split("_")[-1] for f in checkpoint_files)) return last_step # -----------------------------------------------------------------------------