From a459a4438efc8c6afd5661290335118f2a6fcdd8 Mon Sep 17 00:00:00 2001 From: chiiyeh <32455760+chiiyeh@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:22:17 +0800 Subject: [PATCH] set final to true when endpoint detected (#536) --- sherpa/cpp_api/online-recognizer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sherpa/cpp_api/online-recognizer.cc b/sherpa/cpp_api/online-recognizer.cc index a2bd2a641..b056b4147 100644 --- a/sherpa/cpp_api/online-recognizer.cc +++ b/sherpa/cpp_api/online-recognizer.cc @@ -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.;