Support streaming conformer CTC models from wenet (#427)
This commit is contained in:
@@ -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") << ", ";
|
||||
|
||||
Reference in New Issue
Block a user