Fix windows err with checkpoint race conditions (#28637)
Fix windows err
This commit is contained in:
parent
b94f5fdd7e
commit
3001543b94
|
@ -2415,6 +2415,8 @@ class Trainer:
|
|||
os.rename(staging_output_dir, output_dir)
|
||||
|
||||
# Ensure rename completed in cases where os.rename is not atomic
|
||||
# And can only happen on non-windows based systems
|
||||
if os.name != "nt":
|
||||
fd = os.open(output_dir, os.O_RDONLY)
|
||||
os.fsync(fd)
|
||||
os.close(fd)
|
||||
|
|
Loading…
Reference in New Issue