From 3f167476b11efa7ab08f6cacdeb8cab0935c1249 Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Mon, 29 Apr 2024 09:35:45 -0400 Subject: [PATCH] sampling : use std::random_device{}() for default random seed (#6962) --- common/sampling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/sampling.cpp b/common/sampling.cpp index f24665501..cc83600d9 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); }