Unverified Commit 65a02cd2 authored by Nate Brake's avatar Nate Brake Committed by GitHub
Browse files

Add ignore_errors=True to trainer.py rmtree in _inner_training_loop (#31668)

Update trainer.py
parent ddfaf119
......@@ -2422,7 +2422,7 @@ class Trainer:
for checkpoint in checkpoints_sorted:
if not os.path.samefile(checkpoint, self.state.best_model_checkpoint):
logger.info(f"Deleting older checkpoint [{checkpoint}] due to args.save_total_limit")
shutil.rmtree(checkpoint)
shutil.rmtree(checkpoint, ignore_errors=True)
self.control = self.callback_handler.on_train_end(args, self.state, self.control)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment