Skip to content

Commit

Permalink
[BugFix] fix dist dataloader eval (#7778)
Browse files Browse the repository at this point in the history
  • Loading branch information
DesmonDay authored Jan 4, 2024
1 parent 0658258 commit fe3c052
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions paddlenlp/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,9 @@ def get_train_dataloader(self):
)

def _get_eval_sampler(self, eval_dataset: Dataset):
if eval_dataset is None or not has_length(eval_dataset):
return None

if self.args.world_size <= 1:
return paddle.io.BatchSampler(
eval_dataset,
Expand Down

0 comments on commit fe3c052

Please sign in to comment.