From: Daniel Bevenius Date: Mon, 24 Mar 2025 08:36:07 +0000 (+0100) Subject: whisper : initialize decoder's rng with unique seed (#2932) X-Git-Tag: upstream/1.7.5~118 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=cf5ddb8c21a9c598e712804362117ec645f45c3a;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp whisper : initialize decoder's rng with unique seed (#2932) This change initializes each decoder's random number generator with a unique seed. The motivation for this is that currently all decoders are initialized with the same seed value, 0. The result of this is that for the same state (logits, probs, and logprobs) they will produce the same output. --- diff --git a/src/whisper.cpp b/src/whisper.cpp index 1fcb670e..547dcf23 100644 --- a/src/whisper.cpp +++ b/src/whisper.cpp @@ -5528,7 +5528,7 @@ int whisper_full_with_state( decoder.logprobs.resize(ctx->vocab.n_vocab); decoder.logits_id.reserve(ctx->model.hparams.n_vocab); - decoder.rng = std::mt19937(0); + decoder.rng = std::mt19937(j); } // the accumulated text context so far