whisper : perform entropy check only when we have at least 32 tokens (#412)

This commit is contained in:
Georgi Gerganov 2023-01-18 22:52:18 +02:00
parent f583e2d2f5
commit 1a91c19af9
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

View File

@ -3721,7 +3721,7 @@ int whisper_full(
WHISPER_PRINT_DEBUG("%s: decoder %2d: score = %8.5f, result_len = %3d, avg_logprobs = %8.5f, entropy = %8.5f\n",
__func__, j, decoder.sequence.score, decoder.sequence.result_len, decoder.sequence.avg_logprobs, decoder.sequence.entropy);
if (decoder.sequence.result_len > 8 && decoder.sequence.entropy < params.entropy_thold) {
if (decoder.sequence.result_len > 32 && decoder.sequence.entropy < params.entropy_thold) {
WHISPER_PRINT_DEBUG("%s: decoder %2d: failed due to entropy %8.5f < %8.5f\n",
__func__, j, decoder.sequence.entropy, params.entropy_thold);