Skip to content

Commit 82e234e

Browse files
ngxsonpapamoose
authored andcommitted
server: add "schema" and validation (ggml-org#24150)
* wip * working * correct some limits * add field name to error message
1 parent 58e7106 commit 82e234e

6 files changed

Lines changed: 744 additions & 396 deletions

File tree

tools/server/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ add_library(${TARGET} STATIC
1717
server-context.h
1818
server-tools.cpp
1919
server-tools.h
20+
server-schema.cpp
21+
server-schema.h
2022
)
2123

2224
if (BUILD_SHARED_LIBS)

tools/server/server-context.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "server-http.h"
55
#include "server-task.h"
66
#include "server-queue.h"
7+
#include "server-schema.h"
78

89
#include "build-info.h"
910
#include "common.h"
@@ -3825,7 +3826,7 @@ std::unique_ptr<server_res_generator> server_routes::handle_completions_impl(
38253826
task.id = rd.get_new_id();
38263827

38273828
task.tokens = std::move(inputs[i]);
3828-
task.params = server_task::params_from_json_cmpl(
3829+
task.params = server_schema::eval_llama_cmpl_schema(
38293830
ctx_server.vocab,
38303831
params,
38313832
meta->slot_n_ctx,

0 commit comments

Comments
 (0)