xtuner icon indicating copy to clipboard operation
xtuner copied to clipboard

[Feature] add HFCheckpointHook to auto save hf model after the whole training phase

Open HIT-cwh opened this issue 9 months ago • 0 comments

Usage

custom_hooks = [
+    dict(type=HFCheckpointHook),
]

The HF model will be saved at work_dir/timestamp/hf_model

Notes

  1. As the priority of HFCheckpointHook is 95 which is lower than CheckpointHook in MMEngine, the hf model is saved only after the normal checkpoint saving process is complete. So feel free to use it.

HIT-cwh avatar Apr 26 '24 13:04 HIT-cwh