Skip to content

Commit f24f3a4

Browse files
committed
whisper : initialize decoder's rng with unique seed
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 3fc6ad9 commit f24f3a4

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)