Update ruff to 0.11.2 (#36962)

* update

* update

* update

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar
2025-03-25 16:00:11 +01:00
committed by GitHub
parent bc1c90a755
commit c6814b4ee8
152 changed files with 604 additions and 609 deletions

View File

@@ -3005,9 +3005,9 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
)
trainer.train()
# Check that we have the last known step:
assert os.path.exists(
os.path.join(tmp_dir, f"checkpoint-{trainer.state.max_steps}")
), f"Could not find checkpoint-{trainer.state.max_steps}"
assert os.path.exists(os.path.join(tmp_dir, f"checkpoint-{trainer.state.max_steps}")), (
f"Could not find checkpoint-{trainer.state.max_steps}"
)
# And then check the last step
assert os.path.exists(os.path.join(tmp_dir, "checkpoint-9")), "Could not find checkpoint-9"

View File

@@ -180,9 +180,9 @@ class Seq2seqTrainerTester(TestCasePlus):
for num_return_sequences in range(3, 0, -1):
gen_config.num_return_sequences = num_return_sequences
metrics = trainer.evaluate(eval_dataset=prepared_dataset, generation_config=gen_config)
assert (
metrics["eval_samples"] == dataset_len * num_return_sequences
), f"Got {metrics['eval_samples']}, expected: {dataset_len * num_return_sequences}"
assert metrics["eval_samples"] == dataset_len * num_return_sequences, (
f"Got {metrics['eval_samples']}, expected: {dataset_len * num_return_sequences}"
)
@require_torch
def test_bad_generation_config_fail_early(self):