Let's call it now for the next experiment.
python
flush()
In the recent version of the accelerate library, you can also use an utility method called release_memory()
thon
from accelerate.utils import release_memory

release_memory(model)