mirror of
https://github.com/huggingface/trl.git
synced 2025-10-20 18:43:52 +08:00
Fix CI slow test AttributeError: 'TestSFTTrainerSlow' object has no attribute 'addCleanup' (#4255)
This commit is contained in:
committed by
GitHub
parent
039d526d24
commit
86d1963cc1
@ -412,12 +412,12 @@ class TestSFTTrainerSlow(TrlTestCase):
|
||||
eval_dataset=self.eval_dataset,
|
||||
)
|
||||
|
||||
# Register cleanup now that we have the trainer
|
||||
self.addCleanup(cleanup_liger_patches, trainer)
|
||||
|
||||
# Ensure cleanup of liger patches after the test
|
||||
try:
|
||||
trainer.train()
|
||||
|
||||
release_memory(trainer.model, trainer)
|
||||
finally:
|
||||
cleanup_liger_patches(trainer)
|
||||
|
||||
@parameterized.expand(list(itertools.product(MODELS_TO_TEST, PACKING_OPTIONS)))
|
||||
@require_torch_accelerator
|
||||
|
Reference in New Issue
Block a user