From 291980369c1d3cba5d85f78b77b8f944b821d1cc Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sat, 4 Feb 2023 09:03:14 +0200 Subject: [PATCH] whisper : suppress task tokens (#442) --- whisper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/whisper.cpp b/whisper.cpp index d52143f2..97ec46e0 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -2956,6 +2956,10 @@ static void whisper_process_logits( logits[vocab.token_sot] = -INFINITY; logits[vocab.token_solm] = -INFINITY; + // suppress task tokens + logits[vocab.token_translate] = -INFINITY; + logits[vocab.token_transcribe] = -INFINITY; + // timestamps have to appear in pairs, except directly before EOT; mask logits accordingly // https://github.com/openai/whisper/blob/0b1ba3d46ebf7fe6f953acfd8cad62a4f851b49f/whisper/decoding.py#L414-L424 {