diff options
author | Cebtenzzre <cebtenzzre@gmail.com> | 2023-09-01 09:34:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-01 16:34:50 +0300 |
commit | ef156499721c67748cde01a5436cb6f0648bb4b4 (patch) | |
tree | f979837d94e3deab68d38b08ce70441123c888c8 /examples/server | |
parent | d8d6977f48f1fa402ade38ad32c5b5fb1358d059 (diff) |
build : fix most gcc and clang warnings (#2861)
* fix most gcc and clang warnings
* baby-llama : remove commented opt_params_adam
* fix some MinGW warnings
* fix more MinGW warnings
Diffstat (limited to 'examples/server')
-rw-r--r-- | examples/server/server.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/server/server.cpp b/examples/server/server.cpp index b485a5ea..09eac2ec 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -17,6 +17,8 @@ #include "completion.js.hpp" #include "json-schema-to-grammar.mjs.hpp" +#include <cstddef> + #ifndef SERVER_VERBOSE #define SERVER_VERBOSE 1 #endif @@ -1038,7 +1040,7 @@ static json format_timings(llama_server_context &llama) { const auto timings = llama_get_timings(llama.ctx); - assert(timings.n_eval == llama.num_tokens_predicted); + assert(timings.n_eval == ptrdiff_t(llama.num_tokens_predicted)); return json{ {"prompt_n", timings.n_p_eval}, @@ -1239,7 +1241,7 @@ void beam_search_callback(void * callback_data, llama_beams_state beams_state) { const llama_token * tokens = beams_state.beam_views[0].tokens; const auto map = [](llama_token tok) { return completion_token_output{{},tok}; }; std::transform(tokens, tokens + n, llama.generated_token_probs.end() - n, map); - printf("%lu", n); + printf("%zu", n); } fflush(stdout); #if 0 // DEBUG: print current beams for this iteration @@ -1548,7 +1550,7 @@ int main(int argc, char **argv) svr.set_exception_handler([](const Request &, Response &res, std::exception_ptr ep) { - const auto * fmt = "500 Internal Server Error\n%s"; + const char fmt[] = "500 Internal Server Error\n%s"; char buf[BUFSIZ]; try { std::rethrow_exception(std::move(ep)); |