Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto save logic #519

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion open_instruct/dpo_tune.py
Original file line number Diff line number Diff line change
@@ -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)

2 changes: 1 addition & 1 deletion open_instruct/dpo_tune_cache.py
Original file line number Diff line number Diff line change
@@ -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)

2 changes: 1 addition & 1 deletion open_instruct/finetune.py
Original file line number Diff line number Diff line change
@@ -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)

2 changes: 1 addition & 1 deletion open_instruct/ppo_vllm_thread_ray.py
Original file line number Diff line number Diff line change
@@ -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")
2 changes: 1 addition & 1 deletion open_instruct/ppo_vllm_thread_ray_gtrl.py
Original file line number Diff line number Diff line change
@@ -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")