From 2bb992f034689e2ddd7b9ac05163b0359a5957b3 Mon Sep 17 00:00:00 2001 From: Robert Brisita <986796+rbrisita@users.noreply.github.com> Date: Tue, 2 May 2023 12:23:44 -0400 Subject: llama : allow 0 as a seed number. (#1275) --- llama.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llama.cpp') diff --git a/llama.cpp b/llama.cpp index b8751be7..a8156bcc 100644 --- a/llama.cpp +++ b/llama.cpp @@ -809,7 +809,7 @@ struct llama_context_params llama_context_default_params() { struct llama_context_params result = { /*.n_ctx =*/ 512, /*.n_parts =*/ -1, - /*.seed =*/ 0, + /*.seed =*/ -1, /*.f16_kv =*/ false, /*.logits_all =*/ false, /*.vocab_only =*/ false, @@ -2053,7 +2053,7 @@ struct llama_context * llama_init_from_file( llama_context * ctx = new llama_context; - if (params.seed <= 0) { + if (params.seed < 0) { params.seed = time(NULL); } @@ -2395,7 +2395,7 @@ int llama_get_kv_cache_token_count(const struct llama_context * ctx) { #define LLAMA_MAX_RNG_STATE 64*1024 void llama_set_rng_seed(struct llama_context * ctx, int seed) { - if (seed <= 0) { + if (seed < 0) { seed = time(NULL); } ctx->rng.seed(seed); -- cgit v1.2.3