Skip to content

Commit f72fc41

Browse files
DesmonDayJunnYu
authored andcommitted
fix dist dataloader eval (#7777)
1 parent cfdecf6 commit f72fc41

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

paddlenlp/trainer/trainer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,9 @@ def get_train_dataloader(self):
12541254
)
12551255

12561256
def _get_eval_sampler(self, eval_dataset: Dataset):
1257+
if eval_dataset is None or not has_length(eval_dataset):
1258+
return None
1259+
12571260
if self.args.world_size <= 1:
12581261
return paddle.io.BatchSampler(
12591262
eval_dataset,

0 commit comments

Comments
 (0)