Skip to content

Conversation

@HIT-cwh
Copy link
Collaborator

@HIT-cwh HIT-cwh commented Apr 26, 2024

Usage

+ from xtuner.engine.hooks import HFCheckpointHook

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.
@pppppM pppppM merged commit fc41943 into InternLM:main May 10, 2024
@HIT-cwh HIT-cwh deleted the pth_to_hf_hook branch July 26, 2024 11:48
llkn-2 pushed a commit to llkn-2/xtuner that referenced this pull request Jul 31, 2024
…training phase (InternLM#621)

* add HFCheckpointHook to auto save hf model after the whole training phase

* refinie HFCheckpointHook

* fix lint

* delete useless codes

* fix bugs

* support non-dist training
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants