Skip to content
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
10 changes: 10 additions & 0 deletions tuning/trainercontroller/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading