File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 5
5
from torch ._prims_common import DeviceLikeType
6
6
import onnxruntime as ort
7
7
from modules import shared , devices
8
+ from modules .onnx_impl .execution_providers import available_execution_providers , ExecutionProvider
8
9
9
10
10
11
PLATFORM = sys .platform
@@ -61,10 +62,10 @@ def initialize_zluda():
61
62
shared .opts .sdp_options = ['Math attention' ]
62
63
63
64
# ONNX Runtime is not supported
64
- ort .capi ._pybind_state .get_available_providers = lambda : [v for v in ort . get_available_providers () if v != 'CUDAExecutionProvider' ] # pylint: disable=protected-access
65
+ ort .capi ._pybind_state .get_available_providers = lambda : [v for v in available_execution_providers if v != ExecutionProvider . CUDA ] # pylint: disable=protected-access
65
66
ort .get_available_providers = ort .capi ._pybind_state .get_available_providers # pylint: disable=protected-access
66
- if shared .opts .onnx_execution_provider == 'CUDAExecutionProvider' :
67
- shared .opts .onnx_execution_provider = 'CPUExecutionProvider'
67
+ if shared .opts .onnx_execution_provider == ExecutionProvider . CUDA :
68
+ shared .opts .onnx_execution_provider = ExecutionProvider . CPU
68
69
69
70
devices .device_codeformer = devices .cpu
70
71
You can’t perform that action at this time.
0 commit comments