This repository has been archived on 2025-08-26. You can view files and clone it, but cannot push or open issues or pull requests.
Files
enginex-mr_series-sherpa-onnx/sherpa-onnx/csrc/online-ctc-greedy-search-decoder.h
2025-03-02 21:40:13 +08:00

30 lines
836 B
C++

// sherpa-onnx/csrc/online-ctc-greedy-search-decoder.h
//
// Copyright (c) 2023 Xiaomi Corporation
#ifndef SHERPA_ONNX_CSRC_ONLINE_CTC_GREEDY_SEARCH_DECODER_H_
#define SHERPA_ONNX_CSRC_ONLINE_CTC_GREEDY_SEARCH_DECODER_H_
#include <vector>
#include "sherpa-onnx/csrc/online-ctc-decoder.h"
namespace sherpa_onnx {
class OnlineCtcGreedySearchDecoder : public OnlineCtcDecoder {
public:
explicit OnlineCtcGreedySearchDecoder(int32_t blank_id)
: blank_id_(blank_id) {}
void Decode(const float *log_probs, int32_t batch_size, int32_t num_frames,
int32_t vocab_size, std::vector<OnlineCtcDecoderResult> *results,
OnlineStream **ss = nullptr, int32_t n = 0) override;
private:
int32_t blank_id_;
};
} // namespace sherpa_onnx
#endif // SHERPA_ONNX_CSRC_ONLINE_CTC_GREEDY_SEARCH_DECODER_H_