Improve: Support ONNX inference, add ONNX conversion script
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Optional, Sequence
|
||||
from typing import TYPE_CHECKING, Any, Optional, Sequence, Union
|
||||
|
||||
from numpy.typing import NDArray
|
||||
|
||||
@@ -60,8 +60,7 @@ def extract_bert_feature_onnx(
|
||||
text: str,
|
||||
word2ph: list[int],
|
||||
language: Languages,
|
||||
onnx_providers: list[str],
|
||||
onnx_provider_options: Optional[Sequence[dict[str, Any]]],
|
||||
onnx_providers: Sequence[Union[str, tuple[str, dict[str, Any]]]],
|
||||
assist_text: Optional[str] = None,
|
||||
assist_text_weight: float = 0.7,
|
||||
) -> NDArray[Any]:
|
||||
@@ -73,7 +72,6 @@ def extract_bert_feature_onnx(
|
||||
word2ph (list[int]): 元のテキストの各文字に音素が何個割り当てられるかを表すリスト
|
||||
language (Languages): テキストの言語
|
||||
onnx_providers (list[str]): ONNX 推論で利用する ExecutionProvider (CPUExecutionProvider, CUDAExecutionProvider など)
|
||||
onnx_provider_options (Optional[dict[str, Any]]): ONNX 推論で利用する ExecutionProvider のオプション
|
||||
assist_text (Optional[str], optional): 補助テキスト (デフォルト: None)
|
||||
assist_text_weight (float, optional): 補助テキストの重み (デフォルト: 0.7)
|
||||
|
||||
@@ -90,7 +88,6 @@ def extract_bert_feature_onnx(
|
||||
text,
|
||||
word2ph,
|
||||
onnx_providers,
|
||||
onnx_provider_options,
|
||||
assist_text,
|
||||
assist_text_weight,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user