From a2a4eefa07cc852eede78a79fd3d2fd91c8a8114 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Wed, 30 Aug 2023 21:27:51 +0800 Subject: [PATCH] slight change to logits --- gpttype_adapter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp index 25aef2fea..83043a244 100644 --- a/gpttype_adapter.cpp +++ b/gpttype_adapter.cpp @@ -369,7 +369,8 @@ static void TokenizeString(const std::string & str_to_tokenize, std::vector static float LowestLogit(const std::vector & logits) { int topid = std::min_element(logits.begin(), logits.end()) - logits.begin(); - return (logits[topid] < 0 ? logits[topid] : 0); + float v = logits[topid]; + return (v < 0 ? (v-1) : 0); } static float LowestLogit(const float *logits, size_t size) { @@ -378,7 +379,8 @@ static float LowestLogit(const float *logits, size_t size) return 0.0; } int topid = std::min_element(logits, logits + size) - logits; - return (logits[topid] < 0 ? logits[topid] : 0); + float v = logits[topid]; + return (v < 0 ? (v-1) : 0); } static std::string RemoveBell(const std::string & input) //removes the bell character