Spaces:
Running
Running
whisper : suppress task tokens (#442)
Browse files- whisper.cpp +4 -0
whisper.cpp
CHANGED
|
@@ -2956,6 +2956,10 @@ static void whisper_process_logits(
|
|
| 2956 |
logits[vocab.token_sot] = -INFINITY;
|
| 2957 |
logits[vocab.token_solm] = -INFINITY;
|
| 2958 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2959 |
// timestamps have to appear in pairs, except directly before EOT; mask logits accordingly
|
| 2960 |
// https://github.com/openai/whisper/blob/0b1ba3d46ebf7fe6f953acfd8cad62a4f851b49f/whisper/decoding.py#L414-L424
|
| 2961 |
{
|
|
|
|
| 2956 |
logits[vocab.token_sot] = -INFINITY;
|
| 2957 |
logits[vocab.token_solm] = -INFINITY;
|
| 2958 |
|
| 2959 |
+
// suppress task tokens
|
| 2960 |
+
logits[vocab.token_translate] = -INFINITY;
|
| 2961 |
+
logits[vocab.token_transcribe] = -INFINITY;
|
| 2962 |
+
|
| 2963 |
// timestamps have to appear in pairs, except directly before EOT; mask logits accordingly
|
| 2964 |
// https://github.com/openai/whisper/blob/0b1ba3d46ebf7fe6f953acfd8cad62a4f851b49f/whisper/decoding.py#L414-L424
|
| 2965 |
{
|