summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Renshaw <dwrenshaw@gmail.com>2024-04-29 09:35:45 -0400
committerGitHub <noreply@github.com>2024-04-29 16:35:45 +0300
commit3f167476b11efa7ab08f6cacdeb8cab0935c1249 (patch)
tree08f8390f468a38440a5629db236334aacbcf1616
parent3055a4180557c6cbe29eacc8284c9e070ac10eab (diff)
sampling : use std::random_device{}() for default random seed (#6962)
-rw-r--r--common/sampling.cpp2
1 files changed, 1 insertions, 1 deletions
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);
}