From 6659652c9fd1853dcb2d1882efc8f14b159d5d43 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Mon, 7 Aug 2023 11:05:06 +0800 Subject: [PATCH] lower actual temp used when temp=0 --- gpttype_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp index 4ae51ea23..a2283269c 100644 --- a/gpttype_adapter.cpp +++ b/gpttype_adapter.cpp @@ -243,7 +243,7 @@ void sample_temperature(llama_token_data_array * candidates_p, float temp) if (temp <= 0) { // Imitate greedy sampling - temp = 0.01f; //cannot be zero else div0 + temp = 0.00390625f; //cannot be zero else div0, this is 1/256 llama_sample_temperature(nullptr, candidates_p, temp); llama_sample_top_k(nullptr, candidates_p, 1, 1); //only want first candidate }