add shallow fusion (#147)

This commit is contained in:
PF Luo
2023-05-10 22:30:57 +08:00
committed by GitHub
parent 7969cf44ac
commit 824b0809a4
9 changed files with 104 additions and 125 deletions

View File

@@ -34,13 +34,11 @@ struct Hypothesis {
// LM log prob if any.
double lm_log_prob = 0;
int32_t cur_scored_pos = 0; // cur scored tokens by RNN LM
// the nn lm score for next token given the current ys
CopyableOrtValue nn_lm_scores;
// the nn lm states
std::vector<CopyableOrtValue> nn_lm_states;
// TODO(fangjun): Make it configurable
// the minimum of tokens in a chunk for streaming RNN LM
int32_t lm_rescore_min_chunk = 2; // a const
int32_t num_trailing_blanks = 0;
Hypothesis() = default;