Skip to content

Commit f79e203

Browse files
authored
SFT tools schema fix (#252)
1 parent 0ca4a88 commit f79e203

File tree

4 files changed

+40
-377
lines changed

4 files changed

+40
-377
lines changed

docs/sphinx_doc/source/tutorial/faq.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,16 @@ for exp in exp_list:
148148

149149
**A:** You need to specify model path and checkpoint path. The following code snippet gives an example with transformers.
150150

151+
Here is an example of loading from fsdp trainer checkpoints:
152+
151153
```python
152154
import os
153155
from transformers import AutoTokenizer, AutoModelForCausalLM
154-
from trinity.common.models.utils import load_state_dict_from_verl_checkpoint
156+
from trinity.common.models.utils import load_fsdp_state_dict_from_verl_checkpoint
155157

156158
# Assume we need the checkpoint at step 780;
157159
# model_path, checkpoint_root_dir, project, and name are already defined
158160
model = AutoModelForCausalLM.from_pretrained(model_path)
159161
ckp_path = os.path.join(checkpoint_root_dir, project, name, "global_step_780", "actor")
160-
model.load_state_dict(load_state_dict_from_verl_checkpoint(ckp_path))
162+
model.load_state_dict(load_fsdp_state_dict_from_verl_checkpoint(ckp_path))
161163
```

tests/template/data/sft_with_tools/sft_with_tools.json

Lines changed: 0 additions & 371 deletions
This file was deleted.

0 commit comments

Comments
 (0)