aboutsummaryrefslogtreecommitdiff
path: root/examples/perplexity
diff options
context:
space:
mode:
authorHoward Su <howard0su@gmail.com>2023-06-29 21:15:15 +0800
committerGitHub <noreply@github.com>2023-06-29 06:15:15 -0700
commitb8c8dda75fdf5fdea49c80af36818e7c30fe0ddf (patch)
tree85107b89339fe14e31b33703d6dcf440664695ca /examples/perplexity
parent96a712ca1b7f427e3bd7ffc0c70b2105cfc7fbf1 (diff)
Use unsigned for random seed (#2006)
* Use unsigned for random seed. Keep -1 as the value to use a time based seed. Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Diffstat (limited to 'examples/perplexity')
-rw-r--r--examples/perplexity/perplexity.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/perplexity/perplexity.cpp b/examples/perplexity/perplexity.cpp
index f8a6cb5..dd54ed3 100644
--- a/examples/perplexity/perplexity.cpp
+++ b/examples/perplexity/perplexity.cpp
@@ -136,11 +136,11 @@ 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 == LLAMA_DEFAULT_SEED) {
params.seed = time(NULL);
}
- fprintf(stderr, "%s: seed = %d\n", __func__, params.seed);
+ fprintf(stderr, "%s: seed = %u\n", __func__, params.seed);
std::mt19937 rng(params.seed);
if (params.random_prompt) {