Skip to content

Commit

Permalink
Solve the issue of missing the last sentence with punctuation (#856)
Browse files Browse the repository at this point in the history
Co-authored-by: Hao You <13182720519@sina.cn>
  • Loading branch information
yh646492956 and Hao You authored May 10, 2024
1 parent 17cd3a5 commit 1eb60e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sherpa-onnx/csrc/offline-punctuation-ct-transformer-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <string>
#include <utility>
#include <vector>
#include <math.h>

#if __ANDROID_API__ >= 9
#include "android/asset_manager.h"
Expand Down Expand Up @@ -60,7 +61,7 @@ class OfflinePunctuationCtTransformerImpl : public OfflinePunctuationImpl {

int32_t segment_size = 20;
int32_t max_len = 200;
int32_t num_segments = (token_ids.size() + segment_size - 1) / segment_size;
int32_t num_segments = ceil(((float)token_ids.size() + segment_size - 1) / segment_size);

std::vector<int32_t> punctuations;
int32_t last = -1;
Expand Down

0 comments on commit 1eb60e8

Please sign in to comment.