Skip to content

Commit

Permalink
Allow no eval_loader when eval is disabled (#2657)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-chu authored Oct 19, 2023
1 parent 37e52ec commit 772e73e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions composer/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,11 +1217,11 @@ def __init__(
f'Specifying `eval_subset_num_batches={eval_subset_num_batches}` without an `eval_dataloader` '
'has no effect. If trying to run an evaluator, make sure `eval_dataloader` is specified. '
'Otherwise, set `eval_subset_num_batches` to default value -1.')
if eval_interval != 1:
if eval_interval != 0 and eval_interval != 1:
raise ValueError(
f'Specifying `eval_interval={eval_interval}` without an `eval_dataloader` has no effect. '
'If trying to run an evaluator, make sure `eval_dataloader` is specified. Otherwise, '
'set `eval_interval` to default value 1.')
'set `eval_interval` to 0 or default value 1.')

self.state.evaluators = evaluators

Expand Down

0 comments on commit 772e73e

Please sign in to comment.