mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 15:06:28 +08:00
[tune] os.replace() instead of os.rename() for cross-platform (#9141)
Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
@@ -276,7 +276,7 @@ class TrialRunner:
|
||||
with open(tmp_file_name, "w") as f:
|
||||
json.dump(runner_state, f, indent=2, cls=_TuneFunctionEncoder)
|
||||
|
||||
os.rename(tmp_file_name, self.checkpoint_file)
|
||||
os.replace(tmp_file_name, self.checkpoint_file)
|
||||
if force:
|
||||
self._syncer.sync_up()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user