From 5c7f67f97288a29bc405247c90c451d2858efffa Mon Sep 17 00:00:00 2001 From: yashasvi Date: Tue, 28 Oct 2025 18:19:30 +0530 Subject: [PATCH] fix: add hf compatible path update Signed-off-by: yashasvi --- tuning/trainercontroller/callback.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tuning/trainercontroller/callback.py b/tuning/trainercontroller/callback.py index b0c286251b..8cb20993d8 100644 --- a/tuning/trainercontroller/callback.py +++ b/tuning/trainercontroller/callback.py @@ -585,6 +585,16 @@ def on_save( kwargs["path"] = f"{args.output_dir}/checkpoint-{state.global_step}" if "is_final" not in kwargs: kwargs["is_final"] = False + + base_path = kwargs["path"] + hf_converted_path = os.path.join(base_path, "hf_converted_checkpoint") + + if os.path.isdir(hf_converted_path): + kwargs["path"] = hf_converted_path + kwargs["hf_path"] = hf_converted_path + else: + kwargs["hf_path"] = base_path + self._actions_on_event(event_name="on_save", **kwargs) def on_step_begin(