@@ -122,8 +122,8 @@ sft_args = SftArguments(
122
122
model_name = [' 小黄' , ' Xiao Huang' ],
123
123
model_author = [' 魔搭' , ' ModelScope' ])
124
124
output = sft_main(sft_args)
125
- best_model_checkpoint = output[' best_model_checkpoint ' ]
126
- print (f ' best_model_checkpoint : { best_model_checkpoint } ' )
125
+ last_model_checkpoint = output[' last_model_checkpoint ' ]
126
+ print (f ' last_model_checkpoint : { last_model_checkpoint } ' )
127
127
128
128
""" Out[0]
129
129
[INFO:swift] The logging file will be saved in: /xxx/output/qwen2-7b-instruct/v2-20240607-101038/logging.jsonl
@@ -160,7 +160,7 @@ Train: 100%|██████████████████████
160
160
[INFO:swift] best_model_checkpoint: /xxx/output/qwen2-7b-instruct/v2-20240607-101038/checkpoint-93
161
161
[INFO:swift] images_dir: /xxx/output/qwen2-7b-instruct/v2-20240607-101038/images
162
162
[INFO:swift] End time of running main: 2024-06-07 10:18:41.386561
163
- best_model_checkpoint : /xxx/output/qwen2-7b-instruct/v2-20240607-101038/checkpoint-93
163
+ last_model_checkpoint : /xxx/output/qwen2-7b-instruct/v2-20240607-101038/checkpoint-93
164
164
"""
165
165
```
166
166
@@ -200,7 +200,7 @@ swift sft \
200
200
```
201
201
202
202
## Inference After Fine-Tuning
203
- You need to set the value of ` best_model_checkpoint ` , which will be printed out at the end of the sft.
203
+ You need to set the value of ` last_model_checkpoint ` , which will be printed out at the end of the sft.
204
204
205
205
Using Python:
206
206
``` python
@@ -209,8 +209,8 @@ os.environ['CUDA_VISIBLE_DEVICES'] = '0'
209
209
210
210
from swift.llm import InferArguments, merge_lora, infer_main
211
211
212
- best_model_checkpoint = ' qwen2-7b-instruct/vx-xxx/checkpoint-xxx'
213
- infer_args = InferArguments(ckpt_dir = best_model_checkpoint )
212
+ last_model_checkpoint = ' qwen2-7b-instruct/vx-xxx/checkpoint-xxx'
213
+ infer_args = InferArguments(ckpt_dir = last_model_checkpoint )
214
214
merge_lora(infer_args, device_map = ' cpu' )
215
215
result = infer_main(infer_args)
216
216
@@ -271,8 +271,8 @@ os.environ['CUDA_VISIBLE_DEVICES'] = '0'
271
271
272
272
from swift.llm import AppUIArguments, merge_lora, app_ui_main
273
273
274
- best_model_checkpoint = ' qwen2-7b-instruct/vx-xxx/checkpoint-xxx'
275
- app_ui_args = AppUIArguments(ckpt_dir = best_model_checkpoint )
274
+ last_model_checkpoint = ' qwen2-7b-instruct/vx-xxx/checkpoint-xxx'
275
+ app_ui_args = AppUIArguments(ckpt_dir = last_model_checkpoint )
276
276
merge_lora(app_ui_args, device_map = ' cpu' )
277
277
result = app_ui_main(app_ui_args)
278
278
```
0 commit comments