Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit cbff7b8

Browse files
committed
fix symlink
1 parent e8428c1 commit cbff7b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

metaseq/checkpoint_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ def save_checkpoint(
100100
if len(checkpoints) > 1:
101101
# Create symlink between identical checkpoints (differing in naming for epoch/update/last).
102102
for other_checkpoint in checkpoints[1:]:
103+
if PathManager.islink(other_checkpoint):
104+
PathManager.rm(other_checkpoint)
103105
assert PathManager.symlink(
104-
checkpoints[0], other_checkpoint, overwrite=True
106+
checkpoints[0], other_checkpoint
105107
), f"Failed to symlink {checkpoints[0]} to {other_checkpoint}"
106108

107109
write_timer.stop()

0 commit comments

Comments
 (0)