Added provider option to sherpa-onnx and decode-file-c-api (#162)

This commit is contained in:
Jingzhao Ou
2023-06-02 13:57:48 -07:00
committed by GitHub
parent 5e2dc5ceea
commit 0ed501b8f1
9 changed files with 265 additions and 171 deletions

View File

@@ -17,6 +17,8 @@ void OnlineTransducerModelConfig::Register(ParseOptions *po) {
po->Register("tokens", &tokens, "Path to tokens.txt");
po->Register("num_threads", &num_threads,
"Number of threads to run the neural network");
po->Register("provider", &provider,
"Specify a provider to use: cpu, cuda, coreml");
po->Register("debug", &debug,
"true to print model information while loading it.");
@@ -60,6 +62,7 @@ std::string OnlineTransducerModelConfig::ToString() const {
os << "joiner_filename=\"" << joiner_filename << "\", ";
os << "tokens=\"" << tokens << "\", ";
os << "num_threads=" << num_threads << ", ";
os << "provider=\"" << provider << "\", ";
os << "debug=" << (debug ? "True" : "False") << ")";
return os.str();