ZLUDA patch torch only with --use-zluda

This commit is contained in:
Disty0
2024-04-28 12:10:27 +03:00
parent f05ef954a6
commit 7e1c5a2e11
+6 -5
View File
@@ -594,11 +594,12 @@ def check_torch():
if not installed('torch', quiet=True):
log.debug(f'Installing torch: {torch_command}')
install(torch_command, 'torch torchvision')
try:
from modules.zluda_installer import patch as patch_torch
patch_torch()
except Exception as e:
log.warning(f'ZLUDA: failed to automatically patch torch: {e}')
if args.use_zluda:
try:
from modules.zluda_installer import patch as patch_torch
patch_torch()
except Exception as e:
log.warning(f'ZLUDA: failed to automatically patch torch: {e}')
else:
try:
import torch