From 1deef090a9bc43a85b97cb5f8f84868155de433a Mon Sep 17 00:00:00 2001 From: masa-oi <138451555+masa-oi@users.noreply.github.com> Date: Wed, 10 Apr 2024 18:23:28 +0900 Subject: [PATCH] Fix to enter BestSampler route when temperature is 0. (#1659) --- src/decoding.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decoding.cc b/src/decoding.cc index 4c541e490..90fa75b14 100644 --- a/src/decoding.cc +++ b/src/decoding.cc @@ -1007,7 +1007,7 @@ namespace ctranslate2 { static std::unique_ptr make_sampler(const DecodingOptions& options) { - if (options.sampling_topk == 1) + if (options.sampling_topk == 1 || options.sampling_temperature == 0.0) return std::make_unique(); else return std::make_unique(options.sampling_topk,