Skip to content

Commit 4140411

Browse files
committed
fixed 'cp' command on windows
1 parent c3bee7f commit 4140411

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

train.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from optimizers import build_optimizer
1515
from data.ft_dataset import build_ft_dataloader
1616
from hf_utils import load_custom_model_from_hf
17+
import shutil
1718

1819

1920

@@ -36,7 +37,7 @@ def __init__(self,
3637
self.log_dir = os.path.join(config['log_dir'], run_name)
3738
os.makedirs(self.log_dir, exist_ok=True)
3839
# copy config file to log dir
39-
os.system(f'cp {config_path} {self.log_dir}')
40+
shutil.copyfile(config_path, os.path.join(self.log_dir, os.path.basename(config_path)))
4041
batch_size = config.get('batch_size', 10) if batch_size == 0 else batch_size
4142
self.max_steps = steps
4243

0 commit comments

Comments
 (0)