fix: saving ckpt error when ckpt folder has some folder inside (#3516)

This commit is contained in:
Lei Lei authored and GitHub committed 2024-11-08 17:44:39 -05:00
1 parent cef95890f3
commit 9e5bbd9819
1 file changed
+2 -2
+2 -2
View File
@@ -478,8 +478,8 @@ class Trainer:
)
# possibly delete old checkpoints
if self.config.save_only_latest_checkpoint:
# delete everything else in the checkpoint folder
for f in self.checkpoint_dir.glob("*"):
# delete every other checkpoint in the checkpoint folder
for f in self.checkpoint_dir.glob("*.ckpt"):
if f != ckpt_path:
f.unlink()