diff --git a/common/common.cpp b/common/common.cpp index 31a230fec..abe8eaf06 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -1122,7 +1122,7 @@ std::vector string_split(std::string input, char separator) { return parts; } -std::vector sampler_types_from_names(const std::vector& names) { +std::vector sampler_types_from_names(const std::vector & names) { // since samplers names are written multiple ways // make it ready for both system names and input names std::unordered_map sampler_name_map { @@ -1154,7 +1154,7 @@ std::vector sampler_types_from_names(const std::vector sampler_types_from_chars(const std::string& names_string) { +std::vector sampler_types_from_chars(const std::string & names_string) { std::unordered_map sampler_name_map { {'k', llama_sampler_type::TOP_K}, {'p', llama_sampler_type::TOP_P}, diff --git a/common/common.h b/common/common.h index 4ffd1ef35..9bdd45cf9 100644 --- a/common/common.h +++ b/common/common.h @@ -165,8 +165,8 @@ void process_escapes(std::string& input); // String utils // -std::vector sampler_types_from_names(const std::vector& names); -std::vector sampler_types_from_chars(const std::string& names_string); +std::vector sampler_types_from_names(const std::vector & names); +std::vector sampler_types_from_chars(const std::string & names_string); std::vector string_split(std::string input, char separator); std::string sampler_type_to_name_string(llama_sampler_type sampler_type); diff --git a/common/sampling.h b/common/sampling.h index 470610a1b..2bd6a75d2 100644 --- a/common/sampling.h +++ b/common/sampling.h @@ -38,6 +38,7 @@ typedef struct llama_sampling_params { float mirostat_tau = 5.00f; // target entropy float mirostat_eta = 0.10f; // learning rate bool penalize_nl = true; // consider newlines as a repeatable token + std::vector samplers_sequence = { llama_sampler_type::TOP_K, llama_sampler_type::TFS_Z,