aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRobert Brisita <986796+rbrisita@users.noreply.github.com>2023-05-02 12:23:44 -0400
committerGitHub <noreply@github.com>2023-05-02 19:23:44 +0300
commit2bb992f034689e2ddd7b9ac05163b0359a5957b3 (patch)
tree7ee292ca430cc0fcb40730dadcee333608115f9a /examples
parente2cd5069999181a9e4a22cf420e0491878b3062f (diff)
llama : allow 0 as a seed number. (#1275)
Diffstat (limited to 'examples')
-rw-r--r--examples/common.cpp2
-rw-r--r--examples/embedding/embedding.cpp2
-rw-r--r--examples/main/README.md2
-rw-r--r--examples/main/main.cpp2
-rw-r--r--examples/perplexity/perplexity.cpp2
5 files changed, 5 insertions, 5 deletions
diff --git a/examples/common.cpp b/examples/common.cpp
index ad7b0bb..2bf0dc5 100644
--- a/examples/common.cpp
+++ b/examples/common.cpp
@@ -324,7 +324,7 @@ void gpt_print_usage(int /*argc*/, char ** argv, const gpt_params & params) {
fprintf(stderr, " run in interactive mode and 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, use random seed for <= 0)\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");
diff --git a/examples/embedding/embedding.cpp b/examples/embedding/embedding.cpp
index b3e0014..1e9d8a8 100644
--- a/examples/embedding/embedding.cpp
+++ b/examples/embedding/embedding.cpp
@@ -21,7 +21,7 @@ int main(int argc, char ** argv) {
fprintf(stderr, "%s: build = %d (%s)\n", __func__, BUILD_NUMBER, BUILD_COMMIT);
- if (params.seed <= 0) {
+ if (params.seed < 0) {
params.seed = time(NULL);
}
diff --git a/examples/main/README.md b/examples/main/README.md
index 234bf2e..ba210d1 100644
--- a/examples/main/README.md
+++ b/examples/main/README.md
@@ -130,7 +130,7 @@ It is important to note that the generated text may be shorter than the specifie
- `-s SEED, --seed SEED`: Set the random number generator (RNG) seed (default: -1).
-The RNG seed is used to initialize the random number generator that influences the text generation process. By setting a specific seed value, you can obtain consistent and reproducible results across multiple runs with the same input and settings. This can be helpful for testing, debugging, or comparing the effects of different options on the generated text to see when they diverge. If the seed is set to a value less than or equal to 0, a random seed will be used, which will result in different outputs on each run.
+The RNG seed is used to initialize the random number generator that influences the text generation process. By setting a specific seed value, you can obtain consistent and reproducible results across multiple runs with the same input and settings. This can be helpful for testing, debugging, or comparing the effects of different options on the generated text to see when they diverge. If the seed is set to a value less than 0, a random seed will be used, which will result in different outputs on each run.
### Temperature
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index 0514186..727c96c 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -84,7 +84,7 @@ int main(int argc, char ** argv) {
fprintf(stderr, "%s: build = %d (%s)\n", __func__, BUILD_NUMBER, BUILD_COMMIT);
- if (params.seed <= 0) {
+ if (params.seed < 0) {
params.seed = time(NULL);
}
diff --git a/examples/perplexity/perplexity.cpp b/examples/perplexity/perplexity.cpp
index 2ca3388..d474bc5 100644
--- a/examples/perplexity/perplexity.cpp
+++ b/examples/perplexity/perplexity.cpp
@@ -109,7 +109,7 @@ int main(int argc, char ** argv) {
fprintf(stderr, "%s: build = %d (%s)\n", __func__, BUILD_NUMBER, BUILD_COMMIT);
- if (params.seed <= 0) {
+ if (params.seed < 0) {
params.seed = time(NULL);
}