LLM inference in C/C++
C++ ggml
server,common : fix the GCC 12 stringop-overread false positive (again) (#29325)
Adrien Gallouët2b70583997bb
diff --git a/common/speculative.cpp b/common/speculative.cppindex 77dfe9535f..6fdfa4dc33 100644--- a/common/speculative.cpp+++ b/common/speculative.cpp@@ -228,9 +228,7 @@ struct common_speculative_impl_draft_simple : public common_speculative_impl {common_params_sampling params;params.no_perf = false;params.top_k = 10;- params.samplers = {- COMMON_SAMPLER_TYPE_TOP_K,- };+ params.samplers.assign(1, COMMON_SAMPLER_TYPE_TOP_K);smpl.reset(common_sampler_init(llama_get_model(ctx_dft), params));}diff --git a/tools/server/server-context.cpp b/tools/server/server-context.cppindex 274af9b05b..e95fb63ab3 100644--- a/tools/server/server-context.cpp+++ b/tools/server/server-context.cpp@@ -2060,7 +2060,7 @@ private:res->is_begin = true;} else {res->content = tkn.text_to_send;- res->tokens = { tkn.tok };+ res->tokens.assign(1, tkn.tok);}res->n_decoded = slot.stats.n_gen;