Skip to content

Commit

Permalink
Merge pull request #2726 from tomaarsen/fix/no_evaluator
Browse files Browse the repository at this point in the history
[`fix`] Fix edge case with evaluator being None
  • Loading branch information
tomaarsen authored Jun 7, 2024
2 parents b5e98e1 + 4d3e357 commit d9c2b0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sentence_transformers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def __init__(
else:
self.loss = self.prepare_loss(loss, model)
# If evaluator is a list, we wrap it in a SequentialEvaluator
if not isinstance(evaluator, SentenceEvaluator):
if evaluator is not None and not isinstance(evaluator, SentenceEvaluator):
evaluator = SequentialEvaluator(evaluator)
self.evaluator = evaluator

Expand Down

0 comments on commit d9c2b0c

Please sign in to comment.