Intel Gpu support initialization (#4340)
This commit is contained in:
parent
317e2c857e
commit
778a010df8
14 changed files with 106 additions and 42 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue