Support specifying providers in Python API (#198)

This commit is contained in:
Fangjun Kuang
2023-07-06 10:14:01 +08:00
committed by GitHub
parent 3a08191a43
commit 33bf8dc1f4
4 changed files with 17 additions and 1 deletions

View File

@@ -112,6 +112,7 @@ class OfflineRecognizer(object):
feature_dim: int = 80,
decoding_method: str = "greedy_search",
debug: bool = False,
provider: str = "cpu",
):
"""
Please refer to
@@ -138,6 +139,8 @@ class OfflineRecognizer(object):
Valid values are greedy_search, modified_beam_search.
debug:
True to show debug messages.
provider:
onnxruntime execution providers. Valid values are: cpu, cuda, coreml.
"""
self = cls.__new__(cls)
model_config = OfflineModelConfig(
@@ -145,6 +148,7 @@ class OfflineRecognizer(object):
tokens=tokens,
num_threads=num_threads,
debug=debug,
provider=provider,
)
feat_config = OfflineFeatureExtractorConfig(
@@ -170,6 +174,7 @@ class OfflineRecognizer(object):
feature_dim: int = 80,
decoding_method: str = "greedy_search",
debug: bool = False,
provider: str = "cpu",
):
"""
Please refer to
@@ -196,6 +201,8 @@ class OfflineRecognizer(object):
Valid values are greedy_search, modified_beam_search.
debug:
True to show debug messages.
provider:
onnxruntime execution providers. Valid values are: cpu, cuda, coreml.
"""
self = cls.__new__(cls)
model_config = OfflineModelConfig(
@@ -203,6 +210,7 @@ class OfflineRecognizer(object):
tokens=tokens,
num_threads=num_threads,
debug=debug,
provider=provider,
)
feat_config = OfflineFeatureExtractorConfig(