Fix: CUDAExecutionProvider was not being used to infer Style-Bert-VITS2 ONNX models even though CUDA was available
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from typing import Any, Sequence, Union
|
||||
|
||||
|
||||
def torch_device_to_onnx_providers(
|
||||
device: str,
|
||||
) -> Sequence[Union[str, tuple[str, dict[str, Any]]]]:
|
||||
if device.startswith("cuda"):
|
||||
# cudnn_conv_algo_search を DEFAULT にすると推論速度が大幅に向上する
|
||||
# ref: https://medium.com/neuml/debug-onnx-gpu-performance-c9290fe07459
|
||||
return [
|
||||
("CUDAExecutionProvider", {"cudnn_conv_algo_search": "DEFAULT"}),
|
||||
("CPUExecutionProvider", {}),
|
||||
]
|
||||
else:
|
||||
return ["CPUExecutionProvider"]
|
||||
|
||||
Reference in New Issue
Block a user