Skip to content

Commit 99b65aa

Browse files
authored
Reset encoder states on endpointing for streaming transducer. (k2-fsa#924)
1 parent 3f91cdc commit 99b65aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sherpa-onnx/csrc/online-recognizer-transducer-impl.h

+3
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ class OnlineRecognizerTransducerImpl : public OnlineRecognizerImpl {
344344
}
345345
}
346346

347+
// reset encoder states
348+
s->SetStates(model_->GetEncoderInitStates());
349+
347350
// we keep the decoder_out
348351
decoder_->UpdateDecoderOut(&s->GetResult());
349352
Ort::Value decoder_out = std::move(s->GetResult().decoder_out);

0 commit comments

Comments
 (0)