From e4f3d0f740829bd3bb9c745a8faee1d102487775 Mon Sep 17 00:00:00 2001 From: Marcin Junczys-Dowmunt Date: Mon, 9 May 2022 13:28:28 -0700 Subject: [PATCH] add fallback option for sampling, for back-compat --- src/models/model_factory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/models/model_factory.cpp b/src/models/model_factory.cpp index 52a87e72..394344f7 100644 --- a/src/models/model_factory.cpp +++ b/src/models/model_factory.cpp @@ -374,7 +374,10 @@ Ptr createModelFromOptions(Ptr options, usage use) { auto sampling = options->get>("output-sampling", {}); std::string method = sampling.size() > 0 ? sampling[0] : "full"; - if(method == "full" || method == "1" /*for backwards-compat when output-sampling: true in yaml file*/) { + if(method == "0") { /*for backwards-compat when output-sampling: false in yaml file*/ + // do normal decoding + return New(std::dynamic_pointer_cast(baseModel), New()); + } else if(method == "full" || method == "1" /*for backwards-compat when output-sampling: true in yaml file*/) { LOG(info, "Output sampling from the full softmax distribution"); return New(std::dynamic_pointer_cast(baseModel), New()); } else if(method == "topk") {