Skip to content

Commit

Permalink
Extend the no_eval_dataset_with_eval_strategy test with newly updated…
Browse files Browse the repository at this point in the history
… edge case
  • Loading branch information
tomaarsen committed Dec 2, 2024
1 parent 1706dfb commit f168b5c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,14 @@ def test_trainer_no_eval_dataset_with_eval_strategy(
kwargs["evaluator"] = evaluator

if not use_eval_dataset and not use_evaluator:
context = pytest.raises(ValueError, match=".*`args.eval_strategy`.*")
context = pytest.raises(
ValueError,
match=(
"You have set `args.eval_strategy` to IntervalStrategy.STEPS, but you didn't provide an "
"`eval_dataset` or an `evaluator`. Either provide an `eval_dataset` or an `evaluator` "
"to `SentenceTransformerTrainer`, or set `args.eval_strategy='no'` to skip evaluation."
),
)
else:
context = nullcontext()

Expand Down

0 comments on commit f168b5c

Please sign in to comment.