From 664b461d014906b962f4886c8ebcd8051b918e01 Mon Sep 17 00:00:00 2001 From: Askars Salimbajevs <19928242+vsd-vector@users.noreply.github.com> Date: Thu, 3 Apr 2025 17:52:19 +0300 Subject: [PATCH] Disable strict hotword matching mode for offline transducer (#1837) * Disable strict hotword matching mode for offline transducer. Also introduces new variable, so that later this mode can be switched on in the runtime. * remove strict mode variable --------- Co-authored-by: Askars Salimbajevs --- .../csrc/offline-transducer-modified-beam-search-decoder.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sherpa-onnx/csrc/offline-transducer-modified-beam-search-decoder.cc b/sherpa-onnx/csrc/offline-transducer-modified-beam-search-decoder.cc index 7e81624e..d053a6fd 100644 --- a/sherpa-onnx/csrc/offline-transducer-modified-beam-search-decoder.cc +++ b/sherpa-onnx/csrc/offline-transducer-modified-beam-search-decoder.cc @@ -138,7 +138,9 @@ OfflineTransducerModifiedBeamSearchDecoder::Decode( new_hyp.timestamps.push_back(t); if (context_graphs[i] != nullptr) { auto context_res = - context_graphs[i]->ForwardOneStep(context_state, new_token); + context_graphs[i]->ForwardOneStep(context_state, + new_token, + false /* non-strict mode */); context_score = std::get<0>(context_res); new_hyp.context_state = std::get<1>(context_res); }