diff --git a/common/log.h b/common/log.h index 6934c57b2225c..af54bb347afc3 100644 --- a/common/log.h +++ b/common/log.h @@ -596,7 +596,7 @@ inline std::string log_var_to_string_impl(bool var) return var ? "true" : "false"; } -inline std::string log_var_to_string_impl(std::string var) +inline std::string log_var_to_string_impl(const std::string & var) { return var; } diff --git a/common/ngram-cache.cpp b/common/ngram-cache.cpp index 3ca112ef1613d..9ad4a243265b0 100644 --- a/common/ngram-cache.cpp +++ b/common/ngram-cache.cpp @@ -59,7 +59,7 @@ constexpr int draft_min_sample_size_strict[LLAMA_NGRAM_MAX] = { 4, 3, 2, 2}; constexpr int draft_min_percent_strict[LLAMA_NGRAM_MAX] = {75, 66, 66, 66}; // Helper function that tries to draft a token from only the static ngram cache: -static llama_token try_draft(llama_ngram_cache & nc_static, const llama_ngram ngram_static) { +static llama_token try_draft(llama_ngram_cache & nc_static, const llama_ngram & ngram_static) { llama_ngram_cache::iterator part_static_it = nc_static.find(ngram_static); if (part_static_it == nc_static.end()) { return -1; diff --git a/ggml.c b/ggml.c index b96a82a41517d..1471369a4235f 100644 --- a/ggml.c +++ b/ggml.c @@ -3009,7 +3009,7 @@ size_t ggml_used_mem(const struct ggml_context * ctx) { return ctx->objects_end == NULL ? 0 : ctx->objects_end->offs + ctx->objects_end->size; } -size_t ggml_set_scratch(struct ggml_context * ctx, struct ggml_scratch scratch) { +size_t ggml_set_scratch(struct ggml_context * ctx, const struct ggml_scratch scratch) { const size_t result = ctx->scratch.data ? ctx->scratch.offs : 0; ctx->scratch = scratch; @@ -20646,7 +20646,7 @@ static void ggml_opt_acc_grad(int np, struct ggml_tensor * const ps[], float * g static enum ggml_opt_result ggml_opt_adam( struct ggml_context * ctx, struct ggml_opt_context * opt, - struct ggml_opt_params params, + const struct ggml_opt_params params, struct ggml_tensor * f, struct ggml_cgraph * gf, struct ggml_cgraph * gb, @@ -21345,7 +21345,7 @@ struct ggml_opt_params ggml_opt_default_params(enum ggml_opt_type type) { GGML_API void ggml_opt_init( struct ggml_context * ctx, struct ggml_opt_context * opt, - struct ggml_opt_params params, + const struct ggml_opt_params params, int64_t nx) { opt->ctx = ctx; opt->params = params; @@ -21417,7 +21417,7 @@ GGML_API void ggml_opt_init( enum ggml_opt_result ggml_opt( struct ggml_context * ctx, - struct ggml_opt_params params, + const struct ggml_opt_params params, struct ggml_tensor * f) { bool free_ctx = false; if (ctx == NULL) {