Support streaming conformer CTC models from wenet (#427)

This commit is contained in:
Fangjun Kuang
2023-11-16 10:35:23 +08:00
committed by GitHub
parent b83b3e3cd1
commit fac4f6bc7c
31 changed files with 1212 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
// sherpa-onnx/python/csrc/online-wenet-ctc-model-config.cc
//
// Copyright (c) 2023 Xiaomi Corporation
#include "sherpa-onnx/python/csrc/online-wenet-ctc-model-config.h"
#include <string>
#include <vector>
#include "sherpa-onnx/csrc/online-wenet-ctc-model-config.h"
namespace sherpa_onnx {
void PybindOnlineWenetCtcModelConfig(py::module *m) {
using PyClass = OnlineWenetCtcModelConfig;
py::class_<PyClass>(*m, "OnlineWenetCtcModelConfig")
.def(py::init<const std::string &, int32_t, int32_t>(), py::arg("model"),
py::arg("chunk_size") = 16, py::arg("num_left_chunks") = 4)
.def_readwrite("model", &PyClass::model)
.def_readwrite("chunk_size", &PyClass::chunk_size)
.def_readwrite("num_left_chunks", &PyClass::num_left_chunks)
.def("__str__", &PyClass::ToString);
}
} // namespace sherpa_onnx