add shuffle option for single gpu finetunning (#122)

This commit is contained in:
wenmeng zhou
2023-02-21 11:40:07 +08:00
committed by GitHub
parent 8092a82577
commit 3f35e2e866

View File

@@ -975,6 +975,8 @@ class EpochBasedTrainer(BaseTrainer):
dataset, num_replicas=world_size, rank=rank, shuffle=shuffle)
else:
sampler = None
if not isinstance(dataset, torch.utils.data.IterableDataset):
kwargs['shuffle'] = shuffle
batch_sampler = None