diff --git a/examples/train-text-from-scratch/train-text-from-scratch.cpp b/examples/train-text-from-scratch/train-text-from-scratch.cpp index 63f976f0d..d4d293e23 100644 --- a/examples/train-text-from-scratch/train-text-from-scratch.cpp +++ b/examples/train-text-from-scratch/train-text-from-scratch.cpp @@ -3043,12 +3043,11 @@ int main(int argc, char ** argv) { return 1; } - if (params.seed < 0) { - srand(time(NULL)); - } else { - srand(params.seed); + params.seed = time(NULL); } + printf("%s: seed: %d\n", __func__, params.seed); + srand(params.seed); struct llama_context_params llama_params = llama_context_default_params(); llama_params.vocab_only = true;