mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
zluda fix recursion
This commit is contained in:
+4
-3
@@ -5,6 +5,7 @@ import torch
|
||||
from torch._prims_common import DeviceLikeType
|
||||
import onnxruntime as ort
|
||||
from modules import shared, devices
|
||||
from modules.onnx_impl.execution_providers import available_execution_providers, ExecutionProvider
|
||||
|
||||
|
||||
PLATFORM = sys.platform
|
||||
@@ -61,10 +62,10 @@ def initialize_zluda():
|
||||
shared.opts.sdp_options = ['Math attention']
|
||||
|
||||
# ONNX Runtime is not supported
|
||||
ort.capi._pybind_state.get_available_providers = lambda: [v for v in ort.get_available_providers() if v != 'CUDAExecutionProvider'] # pylint: disable=protected-access
|
||||
ort.capi._pybind_state.get_available_providers = lambda: [v for v in available_execution_providers if v != ExecutionProvider.CUDA] # pylint: disable=protected-access
|
||||
ort.get_available_providers = ort.capi._pybind_state.get_available_providers # pylint: disable=protected-access
|
||||
if shared.opts.onnx_execution_provider == 'CUDAExecutionProvider':
|
||||
shared.opts.onnx_execution_provider = 'CPUExecutionProvider'
|
||||
if shared.opts.onnx_execution_provider == ExecutionProvider.CUDA:
|
||||
shared.opts.onnx_execution_provider = ExecutionProvider.CPU
|
||||
|
||||
devices.device_codeformer = devices.cpu
|
||||
|
||||
|
||||
Reference in New Issue
Block a user