added torch.mps.empty_cache() to torch_gc()

changed a bunch of places that use torch.cuda.empty_cache() to use torch_gc() instead
This commit is contained in:
AUTOMATIC1111
2023-07-08 17:13:18 +03:00
parent e161b5a025
commit da8916f926
6 changed files with 10 additions and 13 deletions

View File

@@ -42,10 +42,7 @@ class UpscalerSwinIR(Upscaler):
return img
model = model.to(device_swinir, dtype=devices.dtype)
img = upscale(img, model)
try:
torch.cuda.empty_cache()
except Exception:
pass
devices.torch_gc()
return img
def load_model(self, path, scale=4):