Skip to content

Commit

Permalink
Fix a bug in mean calculation of 'ys_probs' (#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
aask1357 authored Apr 11, 2024
1 parent d21c45d commit 904a3cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sherpa-onnx/csrc/transducer-keyword-decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void TransducerKeywordDecoder::Decode(
if (matched) {
float ys_prob = 0.0;
int32_t length = best_hyp.ys_probs.size();
for (int32_t i = 1; i <= matched_state->level; ++i) {
for (int32_t i = 0; i < matched_state->level; ++i) {
ys_prob += best_hyp.ys_probs[i];
}
ys_prob /= matched_state->level;
Expand Down

0 comments on commit 904a3cc

Please sign in to comment.