From a645b2c5967627b7975f30294035b9994dd65613 Mon Sep 17 00:00:00 2001 From: gohai Date: Sat, 12 Aug 2023 13:34:26 +0800 Subject: [PATCH] LanguageModel: Disable top-p sampling by default This matches upstream llama2.c, and prevents a confusing message with the basic example, which specifies a temperature (thus disabling the default top-p sampling). --- src/LanguageModel/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LanguageModel/index.js b/src/LanguageModel/index.js index e7f88103..518adc7f 100644 --- a/src/LanguageModel/index.js +++ b/src/LanguageModel/index.js @@ -20,7 +20,7 @@ class LanguageModel extends EventEmitter { tokenizerUrl: '', // if set, tokenizer.bin will be preloaded from provided URL (assumed to be embedded in llama2.data if not) maxTokens: 0, // how many tokens to generate (defaults to model's maximum) temperature: 1.0, // 0.0 = (deterministic) argmax sampling, 1.0 = baseline, don't set higher - topp: 0.9, // p value in top-p (nucleus) sampling, 0 = off + topp: 0, // p value in top-p (nucleus) sampling, 0 = off stopOnBosOrEos: true, // stop when encountering beginning-of-sequence or end-of-sequence token };