Skip to content

Commit

Permalink
set final to true when endpoint detected (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
chiiyeh authored Feb 23, 2024
1 parent eef3ef5 commit a459a44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sherpa/cpp_api/online-recognizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class OnlineRecognizer::OnlineRecognizerImpl {
config_.feat_config.fbank_opts.frame_opts.frame_shift_ms,
model_->SubsamplingFactor(), config_.use_bbpe);

ans.is_final = is_final;
ans.is_final = is_final || is_endpoint;
ans.segment = s->GetWavSegment();
float frame_shift_s =
config_.feat_config.fbank_opts.frame_opts.frame_shift_ms / 1000.;
Expand Down

0 comments on commit a459a44

Please sign in to comment.