From cf2a874142eec43fc79064d83457280039423283 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Mon, 9 Sep 2024 19:02:40 +0200 Subject: [PATCH] fix build --- common/arg.cpp | 4 ++-- common/common.h | 1 - common/sampling.cpp | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common/arg.cpp b/common/arg.cpp index 87ae8db4e..cb207eed4 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -329,8 +329,8 @@ bool gpt_params_parse(int argc, char ** argv, llama_arg_context & ctx_arg) { } if (ctx_arg.params.usage) { gpt_params_print_usage(ctx_arg); - if (ctx_arg.params.print_usage) { - ctx_arg.params.print_usage(argc, argv); + if (ctx_arg.print_usage) { + ctx_arg.print_usage(argc, argv); } exit(0); } diff --git a/common/common.h b/common/common.h index 1039862eb..23babdd09 100644 --- a/common/common.h +++ b/common/common.h @@ -232,7 +232,6 @@ struct gpt_params { bool kl_divergence = false; // compute KL divergence - std::function print_usage = nullptr; // print example-specific usage and example bool usage = false; // print usage bool use_color = false; // use color to distinguish generations and inputs bool special = false; // enable special token output diff --git a/common/sampling.cpp b/common/sampling.cpp index 7806b77e0..21b956462 100644 --- a/common/sampling.cpp +++ b/common/sampling.cpp @@ -2,6 +2,9 @@ #include "common.h" +#include +#include + // the ring buffer works similarly to std::deque, but with a fixed capacity // TODO: deduplicate with llama-impl.h template @@ -420,7 +423,7 @@ std::vector gpt_sampler_types_from_names(const std::vector gpt_sampler_types_from_chars(const std::string & chars) { - std::unordered_map sampler_name_map { + std::unordered_map sampler_name_map = { { gpt_sampler_type_to_chr(GPT_SAMPLER_TYPE_TOP_K), GPT_SAMPLER_TYPE_TOP_K }, { gpt_sampler_type_to_chr(GPT_SAMPLER_TYPE_TFS_Z), GPT_SAMPLER_TYPE_TFS_Z }, { gpt_sampler_type_to_chr(GPT_SAMPLER_TYPE_TYPICAL_P), GPT_SAMPLER_TYPE_TYPICAL_P },