tofu icon indicating copy to clipboard operation
tofu copied to clipboard

Fixing order of directory creation for forget.py to prevent exiting

Open mikeFore4 opened this issue 10 months ago • 0 comments

In forget.py script, the cfg.save_dir directory is created (line 57) then later, the script checks whether the directory exists and exits if it does (line 72). Because the directory is being created first, the script ALWAYS exits unless overwrite_dir is true, because the directory ALWAYS exists. This should not be the intended behavior.

In this PR, only the process on local_rank 0 checks if the save_dir exists, if it does, then it exits only if overwrite_dir is set to True. Otherwise, it creates the directory.

mikeFore4 avatar Apr 03 '24 16:04 mikeFore4