Removing parts no longer needed to fix vram

This commit is contained in:
Jairo Correa
2022-10-04 22:28:50 -03:00
parent 1f50971fb8
commit 82380d9ac1
2 changed files with 9 additions and 15 deletions

View File

@@ -1,7 +1,6 @@
import contextlib
import torch
import gc
from modules import errors
@@ -20,8 +19,8 @@ def get_optimal_device():
return cpu
def torch_gc():
gc.collect()
if torch.cuda.is_available():
torch.cuda.empty_cache()
torch.cuda.ipc_collect()