Skip to content

Commit fdf1962

Browse files
authored
Update arguments (#162)
1 parent 4040502 commit fdf1962

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

swift/llm/utils/argument.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ def register_custom_dataset(args: Union[SftArguments, InferArguments]) -> None:
517517
if args.custom_train_dataset_path is None:
518518
assert args.custom_val_dataset_path is None
519519
return
520+
if '_custom_dataset' in DATASET_MAPPING:
521+
DATASET_MAPPING.pop('_custom_dataset')
520522
register_dataset(
521523
'_custom_dataset',
522524
'_custom_dataset',
@@ -549,7 +551,10 @@ def load_from_ckpt_dir(args: InferArguments) -> None:
549551
'custom_val_dataset_path'
550552
]
551553
for key in imported_keys:
552-
if key == 'model_cache_dir' and getattr(args, key) is not None:
554+
if (key in {
555+
'model_cache_dir', 'dataset', 'custom_train_dataset_path',
556+
'custom_val_dataset_path'
557+
} and getattr(args, key) is not None):
553558
continue
554559
setattr(args, key, sft_args.get(key))
555560

0 commit comments

Comments
 (0)