From: David Renshaw Date: Mon, 29 Apr 2024 13:35:45 +0000 (-0400) Subject: sampling : use std::random_device{}() for default random seed (#6962) X-Git-Tag: upstream/0.0.4488~1727 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=3f167476b11efa7ab08f6cacdeb8cab0935c1249;p=pkg%2Fggml%2Fsources%2Fllama.cpp sampling : use std::random_device{}() for default random seed (#6962) --- diff --git a/common/sampling.cpp b/common/sampling.cpp index f2466550..cc83600d 100644 --- a/common/sampling.cpp +++ b/common/sampling.cpp @@ -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); }