Fix lm fusion (#157)

* share GetHypsRowSplits interface and fix getting Topk not taking logprob

* fix lm score of lm fusion and make padding len same with 'icefall/egs/librispeech/ASR/pruned_transducer_stateless7_streaming/decode.py'
This commit is contained in:
PF Luo
2023-05-15 10:48:45 +08:00
committed by GitHub
parent 959f13eac8
commit 655c619bf3
3 changed files with 5 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ class OnlineRnnLM::Impl {
// get lm score for cur token given the hyp->ys[:-1] and save to lm_log_prob
const float *nn_lm_scores = hyp->nn_lm_scores.value.GetTensorData<float>();
hyp->lm_log_prob = nn_lm_scores[hyp->ys.back()] * scale;
hyp->lm_log_prob += nn_lm_scores[hyp->ys.back()] * scale;
// get lm scores for next tokens given the hyp->ys[:] and save to
// nn_lm_scores