Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
65a02cd2
Unverified
Commit
65a02cd2
authored
Jul 03, 2024
by
Nate Brake
Committed by
GitHub
Jul 03, 2024
Browse files
Add ignore_errors=True to trainer.py rmtree in _inner_training_loop (#31668)
Update trainer.py
parent
ddfaf119
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/trainer.py
src/transformers/trainer.py
+1
-1
No files found.
src/transformers/trainer.py
View file @
65a02cd2
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment