Limit number of tokens per second for whisper. (#1958)

Otherwise, it spends lots of time in the loop if the EOT token
is not predicted.
This commit is contained in:
Fangjun Kuang
2025-03-04 15:45:28 +08:00
committed by GitHub
parent 49177530ff
commit 209eaaae1d
4 changed files with 14 additions and 6 deletions

View File

@@ -131,7 +131,7 @@ class OfflineRecognizerWhisperImpl : public OfflineRecognizerImpl {
auto cross_kv = model_->ForwardEncoder(std::move(mel));
auto results = decoder_->Decode(std::move(cross_kv.first),
std::move(cross_kv.second));
std::move(cross_kv.second), num_frames);
auto r = Convert(results[0], symbol_table_);
s->SetResult(r);