From e55ec42d3c5473d83e5e5aa7f0cab34ef9a693b3 Mon Sep 17 00:00:00 2001 From: Eric Tang <46737979+erictang000@users.noreply.github.com> Date: Fri, 14 Feb 2025 05:55:41 -0800 Subject: [PATCH] [ray] specify ray storage path (#6920) Former-commit-id: 6edd4992d700fec56800a638f1cac0f87990c581 --- src/llamafactory/hparams/training_args.py | 6 +++++- src/llamafactory/train/trainer_utils.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/llamafactory/hparams/training_args.py b/src/llamafactory/hparams/training_args.py index 9df24ace..341c5c5e 100644 --- a/src/llamafactory/hparams/training_args.py +++ b/src/llamafactory/hparams/training_args.py @@ -16,7 +16,11 @@ class RayArguments: ray_run_name: Optional[str] = field( default=None, - metadata={"help": "The training results will be saved at `saves/ray_run_name`."}, + metadata={"help": "The training results will be saved at `/ray_run_name`."}, + ) + ray_storage_path: str = field( + default="./saves", + metadata={"help": "The storage path to save training results to"}, ) ray_num_workers: int = field( default=1, diff --git a/src/llamafactory/train/trainer_utils.py b/src/llamafactory/train/trainer_utils.py index a7d89d8f..f3335e1d 100644 --- a/src/llamafactory/train/trainer_utils.py +++ b/src/llamafactory/train/trainer_utils.py @@ -621,7 +621,7 @@ def get_ray_trainer( ), run_config=RunConfig( name=ray_args.ray_run_name, - storage_path=Path("./saves").absolute().as_posix(), + storage_path=Path(ray_args.ray_storage_path).absolute().as_posix(), ), ) return trainer