Skip to content

Commit

Permalink
Fix auto save logic (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
vwxyzjn authored Jan 15, 2025
1 parent 2a1eaaf commit 4365dea
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion open_instruct/dpo_tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ def load_model():
args.try_auto_save_to_beaker
and accelerator.is_main_process
and len(beaker_config.beaker_dataset_id_urls) > 0
and args.output_dir != "/output"
and args.output_dir.rstrip("/") != "/output"
):
shutil.copytree(args.output_dir, "/output", dirs_exist_ok=True)

Expand Down
2 changes: 1 addition & 1 deletion open_instruct/dpo_tune_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ def load_model():
args.try_auto_save_to_beaker
and accelerator.is_main_process
and len(beaker_config.beaker_dataset_id_urls) > 0
and args.output_dir != "/output"
and args.output_dir.rstrip("/") != "/output"
):
shutil.copytree(args.output_dir, "/output", dirs_exist_ok=True)

Expand Down
2 changes: 1 addition & 1 deletion open_instruct/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ def main(args: FlatArguments):
args.try_auto_save_to_beaker
and accelerator.is_main_process
and len(beaker_config.beaker_dataset_id_urls) > 0
and args.output_dir != "/output"
and args.output_dir.rstrip("/") != "/output"
):
shutil.copytree(args.output_dir, "/output", dirs_exist_ok=True)

Expand Down
2 changes: 1 addition & 1 deletion open_instruct/ppo_vllm_thread_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ def vllm_generate(
args.try_auto_save_to_beaker
and self.rank == 0
and len(self.beaker_config.beaker_dataset_id_urls) > 0
and args.output_dir != "/output"
and args.output_dir.rstrip("/") != "/output"
):
shutil.copytree(args.output_dir, "/output", dirs_exist_ok=True)
print("finished training")
Expand Down
2 changes: 1 addition & 1 deletion open_instruct/ppo_vllm_thread_ray_gtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ def vllm_generate(
args.try_auto_save_to_beaker
and self.rank == 0
and len(self.beaker_config.beaker_dataset_id_urls) > 0
and args.output_dir != "/output"
and args.output_dir.rstrip("/") != "/output"
):
shutil.copytree(args.output_dir, "/output", dirs_exist_ok=True)
print("finished training")
Expand Down

0 comments on commit 4365dea

Please sign in to comment.