minor : spaces

This commit is contained in:
Georgi Gerganov 2024-02-11 15:43:11 +02:00 committed by GitHub
parent eb45d123a3
commit e34ebae2b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View file

@ -1122,7 +1122,7 @@ std::vector<std::string> string_split(std::string input, char separator) {
return parts; return parts;
} }
std::vector<llama_sampler_type> sampler_types_from_names(const std::vector<std::string>& names) { std::vector<llama_sampler_type> sampler_types_from_names(const std::vector<std::string> & names) {
// since samplers names are written multiple ways // since samplers names are written multiple ways
// make it ready for both system names and input names // make it ready for both system names and input names
std::unordered_map<std::string, llama_sampler_type> sampler_name_map { std::unordered_map<std::string, llama_sampler_type> sampler_name_map {
@ -1154,7 +1154,7 @@ std::vector<llama_sampler_type> sampler_types_from_names(const std::vector<std::
return sampler_types; return sampler_types;
} }
std::vector<llama_sampler_type> sampler_types_from_chars(const std::string& names_string) { std::vector<llama_sampler_type> sampler_types_from_chars(const std::string & names_string) {
std::unordered_map<char, llama_sampler_type> sampler_name_map { std::unordered_map<char, llama_sampler_type> sampler_name_map {
{'k', llama_sampler_type::TOP_K}, {'k', llama_sampler_type::TOP_K},
{'p', llama_sampler_type::TOP_P}, {'p', llama_sampler_type::TOP_P},

View file

@ -165,8 +165,8 @@ void process_escapes(std::string& input);
// String utils // String utils
// //
std::vector<llama_sampler_type> sampler_types_from_names(const std::vector<std::string>& names); std::vector<llama_sampler_type> sampler_types_from_names(const std::vector<std::string> & names);
std::vector<llama_sampler_type> sampler_types_from_chars(const std::string& names_string); std::vector<llama_sampler_type> sampler_types_from_chars(const std::string & names_string);
std::vector<std::string> string_split(std::string input, char separator); std::vector<std::string> string_split(std::string input, char separator);
std::string sampler_type_to_name_string(llama_sampler_type sampler_type); std::string sampler_type_to_name_string(llama_sampler_type sampler_type);

View file

@ -38,6 +38,7 @@ typedef struct llama_sampling_params {
float mirostat_tau = 5.00f; // target entropy float mirostat_tau = 5.00f; // target entropy
float mirostat_eta = 0.10f; // learning rate float mirostat_eta = 0.10f; // learning rate
bool penalize_nl = true; // consider newlines as a repeatable token bool penalize_nl = true; // consider newlines as a repeatable token
std::vector<llama_sampler_type> samplers_sequence = { std::vector<llama_sampler_type> samplers_sequence = {
llama_sampler_type::TOP_K, llama_sampler_type::TOP_K,
llama_sampler_type::TFS_Z, llama_sampler_type::TFS_Z,