Skip to content

Commit

Permalink
sampling : use std::random_device{}() for default random seed (#6962)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha authored Apr 29, 2024
1 parent 3055a41 commit 3f16747
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void llama_sampling_reset(llama_sampling_context * ctx) {

void llama_sampling_set_rng_seed(struct llama_sampling_context * ctx, uint32_t seed) {
if (seed == LLAMA_DEFAULT_SEED) {
seed = time(NULL);
seed = std::random_device{}();
}
ctx->rng.seed(seed);
}
Expand Down

0 comments on commit 3f16747

Please sign in to comment.