Add HLG decoding for streaming CTC models (#731)

This commit is contained in:
Fangjun Kuang
2024-04-03 21:31:42 +08:00
committed by GitHub
parent f8832cb5f2
commit db67e00c77
28 changed files with 668 additions and 82 deletions

View File

@@ -0,0 +1,32 @@
// sherpa-onnx/csrc/online-ctc-fst-decoder-config.h
//
// Copyright (c) 2024 Xiaomi Corporation
#ifndef SHERPA_ONNX_CSRC_ONLINE_CTC_FST_DECODER_CONFIG_H_
#define SHERPA_ONNX_CSRC_ONLINE_CTC_FST_DECODER_CONFIG_H_
#include <string>
#include "sherpa-onnx/csrc/parse-options.h"
namespace sherpa_onnx {
struct OnlineCtcFstDecoderConfig {
// Path to H.fst, HL.fst or HLG.fst
std::string graph;
int32_t max_active = 3000;
OnlineCtcFstDecoderConfig() = default;
OnlineCtcFstDecoderConfig(const std::string &graph, int32_t max_active)
: graph(graph), max_active(max_active) {}
std::string ToString() const;
void Register(ParseOptions *po);
bool Validate() const;
};
} // namespace sherpa_onnx
#endif // SHERPA_ONNX_CSRC_ONLINE_CTC_FST_DECODER_CONFIG_H_