File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
tests/pipelines/animatediff Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1+ import gc
12import unittest
23
34import numpy as np
1920from diffusers .models .attention import FreeNoiseTransformerBlock
2021from diffusers .utils import is_xformers_available , logging
2122from diffusers .utils .testing_utils import (
22- flush_memory ,
23+ backend_empty_cache ,
2324 numpy_cosine_similarity_distance ,
2425 require_accelerator ,
2526 require_torch_accelerator ,
@@ -552,12 +553,14 @@ class AnimateDiffPipelineSlowTests(unittest.TestCase):
552553 def setUp (self ):
553554 # clean up the VRAM before each test
554555 super ().setUp ()
555- flush_memory (torch_device , gc_collect = True )
556+ gc .collect ()
557+ backend_empty_cache (torch_device )
556558
557559 def tearDown (self ):
558560 # clean up the VRAM after each test
559561 super ().tearDown ()
560- flush_memory (torch_device , gc_collect = True )
562+ gc .collect ()
563+ backend_empty_cache (torch_device )
561564
562565 def test_animatediff (self ):
563566 adapter = MotionAdapter .from_pretrained ("guoyww/animatediff-motion-adapter-v1-5-2" )
You can’t perform that action at this time.
0 commit comments