Kaynağa Gözat

sampling : use std::random_device{}() for default random seed (#6962)

David Renshaw 1 yıl önce
ebeveyn
işleme
3f167476b1
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      common/sampling.cpp

+ 1 - 1
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);
 }