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

@@ -8,6 +8,7 @@
#include <memory>
#include <vector>
#include "kaldi-decoder/csrc/faster-decoder.h"
#include "onnxruntime_cxx_api.h" // NOLINT
#include "sherpa-onnx/csrc/context-graph.h"
#include "sherpa-onnx/csrc/features.h"
@@ -97,6 +98,11 @@ class OnlineStream {
*/
const ContextGraphPtr &GetContextGraph() const;
// for online ctc decoder
void SetFasterDecoder(std::unique_ptr<kaldi_decoder::FasterDecoder> decoder);
kaldi_decoder::FasterDecoder *GetFasterDecoder() const;
int32_t &GetFasterDecoderProcessedFrames();
// for streaming paraformer
std::vector<float> &GetParaformerFeatCache();
std::vector<float> &GetParaformerEncoderOutCache();