Add C++ support for streaming NeMo CTC models. (#857)
This commit is contained in:
@@ -4,11 +4,12 @@
|
||||
#ifndef SHERPA_ONNX_CSRC_OFFLINE_PUNCTUATION_CT_TRANSFORMER_IMPL_H_
|
||||
#define SHERPA_ONNX_CSRC_OFFLINE_PUNCTUATION_CT_TRANSFORMER_IMPL_H_
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <math.h>
|
||||
|
||||
#if __ANDROID_API__ >= 9
|
||||
#include "android/asset_manager.h"
|
||||
@@ -61,7 +62,9 @@ class OfflinePunctuationCtTransformerImpl : public OfflinePunctuationImpl {
|
||||
|
||||
int32_t segment_size = 20;
|
||||
int32_t max_len = 200;
|
||||
int32_t num_segments = ceil(((float)token_ids.size() + segment_size - 1) / segment_size);
|
||||
int32_t num_segments =
|
||||
ceil((static_cast<float>(token_ids.size()) + segment_size - 1) /
|
||||
segment_size);
|
||||
|
||||
std::vector<int32_t> punctuations;
|
||||
int32_t last = -1;
|
||||
|
||||
Reference in New Issue
Block a user