diff --git a/common/sampling.cpp b/common/sampling.cpp index f24665501..f77dad5b3 100644 --- a/common/sampling.cpp +++ b/common/sampling.cpp @@ -1,5 +1,6 @@ #define LLAMA_API_INTERNAL #include "sampling.h" +#include #include struct llama_sampling_context * llama_sampling_init(const struct llama_sampling_params & params) { @@ -68,7 +69,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 = static_cast(std::chrono::system_clock::now().time_since_epoch().count()); } ctx->rng.seed(seed); }