From 53e505d5049696970d4a7ba2cf7ca314d10edc66 Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Sun, 28 Apr 2024 08:26:46 -0400 Subject: [PATCH] use std::random_device{}() for default random seed --- 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); }