From fd273c9c83202ce42fcf06e00bded976b6aa1274 Mon Sep 17 00:00:00 2001 From: Hao You <13182720519@sina.cn> Date: Fri, 10 May 2024 14:43:42 +0800 Subject: [PATCH] Solve the issue of missing the last sentence with punctuation --- sherpa-onnx/csrc/offline-punctuation-ct-transformer-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sherpa-onnx/csrc/offline-punctuation-ct-transformer-impl.h b/sherpa-onnx/csrc/offline-punctuation-ct-transformer-impl.h index 9699563cb..2c2628dbc 100644 --- a/sherpa-onnx/csrc/offline-punctuation-ct-transformer-impl.h +++ b/sherpa-onnx/csrc/offline-punctuation-ct-transformer-impl.h @@ -60,7 +60,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 punctuations; int32_t last = -1;