From c962ae3382a1e759c8517a229549ee53685313a1 Mon Sep 17 00:00:00 2001 From: Sky Date: Wed, 28 May 2025 22:33:54 +0800 Subject: [PATCH] server: fix remove 'image_url'/'input_audio' json-object effectlly for 'llama_params' in multimodal-model-mode (#13853) [fix]: remove 'image_url'/'input_audio' effectlly for 'llama_params' in multimodal-model-mode --- tools/server/utils.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/server/utils.hpp b/tools/server/utils.hpp index 8456a02e..14e09f95 100644 --- a/tools/server/utils.hpp +++ b/tools/server/utils.hpp @@ -573,7 +573,7 @@ struct oaicompat_parser_options { // used by /chat/completions endpoint static json oaicompat_chat_params_parse( - const json & body, /* openai api json semantics */ + json & body, /* openai api json semantics */ const oaicompat_parser_options & opt, std::vector & out_files) { @@ -624,7 +624,7 @@ static json oaicompat_chat_params_parse( if (!body.contains("messages")) { throw std::runtime_error("'messages' is required"); } - json messages = body.at("messages"); + json & messages = body.at("messages"); if (!messages.is_array()) { throw std::runtime_error("Expected 'messages' to be an array"); }