tofu
tofu copied to clipboard
Fixing order of directory creation for forget.py to prevent exiting
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.