]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
sampling : use std::random_device{}() for default random seed (#6962)
authorDavid Renshaw <redacted>
Mon, 29 Apr 2024 13:35:45 +0000 (09:35 -0400)
committerGitHub <redacted>
Mon, 29 Apr 2024 13:35:45 +0000 (16:35 +0300)
common/sampling.cpp

index f2466550168a7781dbf0106fcfabef1c1e0757be..cc83600d9926ee68007e3d28fb92766150a4c143 100644 (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);
 }