Add Kotlin API for Matcha-TTS models. (#1668)

This commit is contained in:
Fangjun Kuang
2024-12-31 19:20:52 +08:00
committed by GitHub
parent 0a43e9c879
commit 3422b9388d
9 changed files with 117 additions and 9 deletions

View File

@@ -1727,11 +1727,15 @@ const SherpaOnnxOnlinePunctuation *SherpaOnnxCreateOnlinePunctuation(
auto p = new SherpaOnnxOnlinePunctuation;
try {
sherpa_onnx::OnlinePunctuationConfig punctuation_config;
punctuation_config.model.cnn_bilstm = SHERPA_ONNX_OR(config->model.cnn_bilstm, "");
punctuation_config.model.bpe_vocab = SHERPA_ONNX_OR(config->model.bpe_vocab, "");
punctuation_config.model.num_threads = SHERPA_ONNX_OR(config->model.num_threads, 1);
punctuation_config.model.cnn_bilstm =
SHERPA_ONNX_OR(config->model.cnn_bilstm, "");
punctuation_config.model.bpe_vocab =
SHERPA_ONNX_OR(config->model.bpe_vocab, "");
punctuation_config.model.num_threads =
SHERPA_ONNX_OR(config->model.num_threads, 1);
punctuation_config.model.debug = config->model.debug;
punctuation_config.model.provider = SHERPA_ONNX_OR(config->model.provider, "cpu");
punctuation_config.model.provider =
SHERPA_ONNX_OR(config->model.provider, "cpu");
p->impl =
std::make_unique<sherpa_onnx::OnlinePunctuation>(punctuation_config);