Skip to content

Commit 691c3d4

Browse files
authored
[megatron] fix val_dataset (#4478)
1 parent 88be385 commit 691c3d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

swift/megatron/train/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def swift_datasets_provider(train_val_test_num_samples):
1919
step_batch_size = \
2020
args.micro_batch_size * data_parallel_size
2121
# To avoid errors caused by the validation set being insufficient to complete a single step.
22-
if len(val_dataset) < step_batch_size:
22+
if val_dataset is not None and len(val_dataset) < step_batch_size:
2323
val_dataset = None
2424
return train_dataset, val_dataset, None
2525

0 commit comments

Comments
 (0)