use suggested idea instead of my overly verbose way
This commit is contained in:
parent
b407a4e9a7
commit
6f29bcbdae
1 changed files with 2 additions and 4 deletions
|
@ -4127,11 +4127,9 @@ int main(int argc, char ** argv) {
|
|||
const auto handle_apply_template = [&ctx_server, ¶ms, &res_ok](const httplib::Request & req, httplib::Response & res) {
|
||||
auto body = json::parse(req.body);
|
||||
const auto & chat_template = body.contains("tools") && ctx_server.chat_templates.template_tool_use ? *ctx_server.chat_templates.template_tool_use : *ctx_server.chat_templates.template_default;
|
||||
json data = oaicompat_completion_params_parse(body, chat_template, params.use_jinja);
|
||||
|
||||
// format and return only the "prompt" field
|
||||
json data = json::object();
|
||||
data["prompt"] = oaicompat_completion_params_parse(body, chat_template, params.use_jinja)["prompt"];
|
||||
res_ok(res, data);
|
||||
res_ok(res, {{ "prompt", data.at("prompt") }});
|
||||
};
|
||||
|
||||
const auto handle_embeddings = [&handle_embeddings_impl](const httplib::Request & req, httplib::Response & res) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue