From: Ycros Date: Wed, 7 May 2025 08:23:28 +0000 (+1000) Subject: common : Add a warning when we can't match samplers from a string or char. (#13330) X-Git-Tag: upstream/0.0.5318~16 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=39e73ae0d69f882d7e29cecc6dd8f5052fca6731;p=pkg%2Fggml%2Fsources%2Fllama.cpp common : Add a warning when we can't match samplers from a string or char. (#13330) --- diff --git a/common/sampling.cpp b/common/sampling.cpp index bbaec5b8..28705e24 100644 --- a/common/sampling.cpp +++ b/common/sampling.cpp @@ -1,6 +1,7 @@ #include "sampling.h" #include "common.h" +#include "log.h" #include #include @@ -534,14 +535,16 @@ std::vector common_sampler_types_from_names(const std::vect auto sampler = sampler_canonical_name_map.find(name); if (sampler != sampler_canonical_name_map.end()) { samplers.push_back(sampler->second); - } else { - if (allow_alt_names) { - sampler = sampler_alt_name_map.find(name); - if (sampler != sampler_alt_name_map.end()) { - samplers.push_back(sampler->second); - } + continue; + } + if (allow_alt_names) { + sampler = sampler_alt_name_map.find(name); + if (sampler != sampler_alt_name_map.end()) { + samplers.push_back(sampler->second); + continue; } } + LOG_WRN("%s: unable to match sampler by name '%s'\n", __func__, name.c_str()); } return samplers; @@ -568,6 +571,8 @@ std::vector common_sampler_types_from_chars(const std::stri const auto sampler = sampler_name_map.find(c); if (sampler != sampler_name_map.end()) { samplers.push_back(sampler->second); + } else { + LOG_WRN("%s: unable to match sampler by char '%c'\n", __func__, c); } }