Skip to content

Commit

Permalink
Reset encoder states on endpointing for streaming transducer. (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored May 28, 2024
1 parent 5860e45 commit 50a2eaa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sherpa-onnx/csrc/online-recognizer-transducer-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ class OnlineRecognizerTransducerImpl : public OnlineRecognizerImpl {
}
}

// reset encoder states
s->SetStates(model_->GetEncoderInitStates());

// we keep the decoder_out
decoder_->UpdateDecoderOut(&s->GetResult());
Ort::Value decoder_out = std::move(s->GetResult().decoder_out);
Expand Down

0 comments on commit 50a2eaa

Please sign in to comment.