Skip to content

Commit 73ef92a

Browse files
danbevlinxiaodong
authored andcommitted
whisper : initialize decoder's rng with unique seed (ggml-org#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.
1 parent 0ef2821 commit 73ef92a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/whisper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5528,7 +5528,7 @@ int whisper_full_with_state(
55285528
decoder.logprobs.resize(ctx->vocab.n_vocab);
55295529
decoder.logits_id.reserve(ctx->model.hparams.n_vocab);
55305530

5531-
decoder.rng = std::mt19937(0);
5531+
decoder.rng = std::mt19937(j);
55325532
}
55335533

55345534
// the accumulated text context so far

0 commit comments

Comments
 (0)