mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Run garbage collection to allow the CUDA cache to completely empty. (#2791)
This commit is contained in:
parent
39c57aa358
commit
ec2890c19b
@ -650,6 +650,8 @@ class Generate:
|
||||
def clear_cuda_cache(self):
|
||||
if self._has_cuda():
|
||||
self.gather_cuda_stats()
|
||||
# Run garbage collection prior to emptying the CUDA cache
|
||||
gc.collect()
|
||||
torch.cuda.empty_cache()
|
||||
|
||||
def clear_cuda_stats(self):
|
||||
|
Loading…
Reference in New Issue
Block a user