xtuner
xtuner copied to clipboard
[Feature] add HFCheckpointHook to auto save hf model after the whole training phase
Usage
custom_hooks = [
+ dict(type=HFCheckpointHook),
]
The HF model will be saved at work_dir/timestamp/hf_model
Notes
- As the priority of
HFCheckpointHook
is 95 which is lower thanCheckpointHook
in MMEngine, the hf model is saved only after the normal checkpoint saving process is complete. So feel free to use it.