fix typos in the tests directory (#36717)

This commit is contained in:
Afanti
2025-03-18 01:45:57 +08:00
committed by GitHub
parent cbfb8d7b27
commit 7f5077e536
14 changed files with 22 additions and 22 deletions

View File

@@ -241,7 +241,7 @@ def bytes2megabytes(x):
return int(x / 2**20)
# Copied from acclerate: https://github.com/huggingface/accelerate/blob/ee163b66fb7848892519e804688cb4ae981aacbe/src/accelerate/test_utils/scripts/external_deps/test_peak_memory_usage.py#L40C1-L73C68
# Copied from accelerate: https://github.com/huggingface/accelerate/blob/ee163b66fb7848892519e804688cb4ae981aacbe/src/accelerate/test_utils/scripts/external_deps/test_peak_memory_usage.py#L40C1-L73C68
class TorchTracemalloc:
def __enter__(self):
gc.collect()
@@ -4086,7 +4086,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
# Functional check
self.assertAlmostEqual(loss, orig_loss)
# AOT Autograd recomputaion and nvfuser recomputation optimization
# AOT Autograd recomputation and nvfuser recomputation optimization
# aggressively fuses the operations and reduce the memory footprint.
self.assertGreater(orig_peak_mem, peak_mem * 2)

View File

@@ -186,7 +186,7 @@ class Seq2seqTrainerTester(TestCasePlus):
@require_torch
def test_bad_generation_config_fail_early(self):
# Tests that a bad geneartion config causes the trainer to fail early
# Tests that a bad generation config causes the trainer to fail early
model = AutoModelForSeq2SeqLM.from_pretrained("google-t5/t5-small")
tokenizer = T5Tokenizer.from_pretrained("google-t5/t5-small")
data_collator = DataCollatorForSeq2Seq(tokenizer, model=model, return_tensors="pt", padding="longest")