When seed <= 0 - use the clock to generate one

This commit is contained in:
Georgi Gerganov 2023-03-22 07:47:15 +02:00
parent 928480ef5b
commit ae44e23ee3
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
2 changed files with 2 additions and 2 deletions

View file

@ -170,7 +170,7 @@ int main(int argc, char ** argv) {
"expect poor results\n", __func__, params.n_ctx);
}
if (params.seed < 0) {
if (params.seed <= 0) {
params.seed = time(NULL);
}

View file

@ -101,7 +101,7 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
fprintf(stderr, " in interactive mode, poll user input upon seeing PROMPT (can be\n");
fprintf(stderr, " specified more than once for multiple prompts).\n");
fprintf(stderr, " --color colorise output to distinguish prompt and user input from generations\n");
fprintf(stderr, " -s SEED, --seed SEED RNG seed (default: -1)\n");
fprintf(stderr, " -s SEED, --seed SEED RNG seed (default: -1, use random seed for <= 0)\n");
fprintf(stderr, " -t N, --threads N number of threads to use during computation (default: %d)\n", params.n_threads);
fprintf(stderr, " -p PROMPT, --prompt PROMPT\n");
fprintf(stderr, " prompt to start generation with (default: empty)\n");