Skip to content

Commit

Permalink
whisper : suppress task tokens (ggerganov#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Feb 4, 2023
1 parent 86ef64a commit 2919803
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions whisper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 2919803

Please sign in to comment.