mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-01-29 09:19:01 +01:00
whisper : condition timestamps to be monotonically increasing (#425)
This commit is contained in:
parent
ae16c21e9c
commit
b5ddb16ec7
10
whisper.cpp
10
whisper.cpp
@ -2988,6 +2988,16 @@ static void whisper_process_logits(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// condition timestamp tokens to be increasing
|
||||||
|
// ref: https://github.com/openai/whisper/pull/831#issuecomment-1385910556
|
||||||
|
if (decoder.has_ts) {
|
||||||
|
const int tid0 = decoder.seek_delta/2;
|
||||||
|
|
||||||
|
for (int i = vocab.token_beg; i < vocab.token_beg + tid0; ++i) {
|
||||||
|
logits[i] = -INFINITY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// populate the logprobs array (log_softmax)
|
// populate the logprobs array (log_softmax)
|
||||||
{
|
{
|
||||||
const float logit_max = *std::max_element(logits.begin(), logits.end());
|
const float logit_max = *std::max_element(logits.begin(), logits.end());
|
||||||
|
Loading…
Reference in New Issue
Block a user