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

@@ -13,6 +13,7 @@ namespace sherpa_onnx {
void OnlineModelConfig::Register(ParseOptions *po) {
transducer.Register(po);
paraformer.Register(po);
wenet_ctc.Register(po);
po->Register("tokens", &tokens, "Path to tokens.txt");
@@ -46,6 +47,10 @@ bool OnlineModelConfig::Validate() const {
return paraformer.Validate();
}
if (!wenet_ctc.model.empty()) {
return wenet_ctc.Validate();
}
return transducer.Validate();
}
@@ -55,6 +60,7 @@ std::string OnlineModelConfig::ToString() const {
os << "OnlineModelConfig(";
os << "transducer=" << transducer.ToString() << ", ";
os << "paraformer=" << paraformer.ToString() << ", ";
os << "wenet_ctc=" << wenet_ctc.ToString() << ", ";
os << "tokens=\"" << tokens << "\", ";
os << "num_threads=" << num_threads << ", ";
os << "debug=" << (debug ? "True" : "False") << ", ";