Intel Gpu support initialization (#4340)

This commit is contained in:
Abhilash Majumder 2023-10-27 08:09:51 +05:30 committed by GitHub
parent 317e2c857e
commit 778a010df8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 106 additions and 42 deletions

View file

@ -5,6 +5,7 @@ from threading import Thread
import torch
import transformers
from transformers import is_torch_xpu_available
import modules.shared as shared
@ -92,4 +93,7 @@ class Iteratorize:
def clear_torch_cache():
gc.collect()
if not shared.args.cpu:
torch.cuda.empty_cache()
if is_torch_xpu_available():
torch.xpu.empty_cache()
else:
torch.cuda.empty_cache()