File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11import os
2+ import sys
23import time
34from dataclasses import fields
45from typing import Dict , Type
@@ -262,7 +263,14 @@ def train(cls, *args):
262263 cuda_param = f'CUDA_VISIBLE_DEVICES={ gpus } '
263264
264265 log_file = os .path .join (sft_args .logging_dir , 'run.log' )
265- run_command = f'{ cuda_param } { ddp_param } nohup swift sft { params } > { log_file } 2>&1 &'
266+ if sys .platform == 'win32' :
267+ if cuda_param :
268+ cuda_param = f'set { cuda_param } && '
269+ if ddp_param :
270+ ddp_param = f'set { ddp_param } && '
271+ run_command = f'{ cuda_param } { ddp_param } start /b swift sft { params } > { log_file } 2>&1'
272+ else :
273+ run_command = f'{ cuda_param } { ddp_param } nohup swift sft { params } > { log_file } 2>&1 &'
266274 logger .info (f'Run training: { run_command } ' )
267275 if not other_kwargs ['dry_run' ]:
268276 os .makedirs (sft_args .logging_dir , exist_ok = True )
You can’t perform that action at this time.
0 commit comments