sampling : use std::random_device{}() for default random seed (#6962)

This commit is contained in:
David Renshaw 2024-04-29 09:35:45 -04:00 committed by GitHub
parent 3055a41805
commit 3f167476b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}