Golden path
This commit is contained in:
committed by
Lysandre Debut
parent
528d3f327b
commit
bf34a252b8
@@ -114,7 +114,9 @@ def _rotate_checkpoints(args, checkpoint_prefix, use_mtime=False):
|
||||
|
||||
# Check if we should delete older checkpoint(s)
|
||||
glob_checkpoints = glob.glob(os.path.join(args.output_dir, '{}-*'.format(checkpoint_prefix)))
|
||||
if len(glob_checkpoints) > args.save_total_limit:
|
||||
if len(glob_checkpoints) <= args.save_total_limit:
|
||||
return
|
||||
|
||||
checkpoints_sorted = []
|
||||
for path in glob_checkpoints:
|
||||
regex_match = re.match('.*{}-([0-9]+)'.format(checkpoint_prefix), path)
|
||||
|
||||
Reference in New Issue
Block a user