Skip to content

Commit

Permalink
Updated incorrect test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanswyi authored Dec 22, 2024
1 parent 84e91d1 commit 8accf30
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/trainer/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4236,15 +4236,15 @@ def test_save_best_checkpoint(self):

# Case 4: Metric name not provided and save_best_strategy is "steps" (i.e., not "best").
with tempfile.TemporaryDirectory() as tmpdir:
with self.assertRaises(ValueError) as context:
trainer = get_regression_trainer(
a=1.5,
b=2.5,
output_dir=tmpdir,
learning_rate=0.1,
eval_strategy="epoch",
save_strategy="steps",
)
trainer = get_regression_trainer(
a=1.5,
b=2.5,
output_dir=tmpdir,
learning_rate=0.1,
eval_strategy="epoch",
save_strategy="steps",
load_best_model_at_end=True,
)
self.assertTrue(trainer.args.metric_for_best_model == "loss")


Expand Down

0 comments on commit 8accf30

Please sign in to comment.