danbev commited on
Commit
6322856
·
unverified ·
1 Parent(s): 6f57276

whisper : initialize decoder's rng with unique seed (#2932)

Browse files

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.

Files changed (1) hide show
  1. src/whisper.cpp +1 -1
src/whisper.cpp CHANGED
@@ -5528,7 +5528,7 @@ int whisper_full_with_state(
5528
  decoder.logprobs.resize(ctx->vocab.n_vocab);
5529
  decoder.logits_id.reserve(ctx->model.hparams.n_vocab);
5530
 
5531
- decoder.rng = std::mt19937(0);
5532
  }
5533
 
5534
  // the accumulated text context so far
 
5528
  decoder.logprobs.resize(ctx->vocab.n_vocab);
5529
  decoder.logits_id.reserve(ctx->model.hparams.n_vocab);
5530
 
5531
+ decoder.rng = std::mt19937(j);
5532
  }
5533
 
5534
  // the accumulated text context so far