Skip to content

Commit

Permalink
Fix to enter BestSampler route when temperature is 0. (#1659)
Browse files Browse the repository at this point in the history
  • Loading branch information
masa-oi authored Apr 10, 2024
1 parent 7d63eea commit 1deef09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/decoding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ namespace ctranslate2 {

static std::unique_ptr<const Sampler>
make_sampler(const DecodingOptions& options) {
if (options.sampling_topk == 1)
if (options.sampling_topk == 1 || options.sampling_temperature == 0.0)
return std::make_unique<BestSampler>();
else
return std::make_unique<RandomSampler>(options.sampling_topk,
Expand Down

0 comments on commit 1deef09

Please sign in to comment.