Skip to content

Commit

Permalink
fix dist dataloader eval (#7777)
Browse files Browse the repository at this point in the history
  • Loading branch information
DesmonDay authored Jan 4, 2024
1 parent f93e7da commit 4437198
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 4437198

Please sign in to comment.