summaryrefslogtreecommitdiff
path: root/common/common.cpp
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-10-28 14:23:11 +0300
committerGitHub <noreply@github.com>2023-10-28 14:23:11 +0300
commitee1a0ec9cb367ba41d138134795cbbbe93d2bf1c (patch)
tree04111cbd66f34c6cc986e70bb47b96b39828e0f2 /common/common.cpp
parent177461104b454163473dced2a5038f4e016cdb7e (diff)
llama : add option for greedy sampling with probs (#3813)
* llama : add option for greedy sampling with probs * llama : add comment about llama_sample_token_greedy() missing probs * sampling : temp == 0.0 -> no probs, temp < 0.0 -> probs
Diffstat (limited to 'common/common.cpp')
-rw-r--r--common/common.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/common.cpp b/common/common.cpp
index c0d4924e..f81f4d35 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -224,6 +224,7 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
break;
}
sparams.temp = std::stof(argv[i]);
+ sparams.temp = std::max(sparams.temp, 0.0f);
} else if (arg == "--tfs") {
if (++i >= argc) {
invalid_param = true;