Skip to content

Commit

Permalink
Solve the issue of missing the last sentence with punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
Hao You committed May 10, 2024
1 parent 17cd3a5 commit fd273c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sherpa-onnx/csrc/offline-punctuation-ct-transformer-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int32_t> punctuations;
int32_t last = -1;
Expand Down

0 comments on commit fd273c9

Please sign in to comment.