From 63978cb6dcdd9966ab2714873d18235bfd2a51a4 Mon Sep 17 00:00:00 2001 From: zhenweijin Date: Fri, 18 Oct 2024 18:06:19 +0800 Subject: [PATCH] server: handle n_predict==2 error --- examples/server/server.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 8fd443878..e428954fa 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -243,6 +243,8 @@ struct server_slot { if (params.n_predict != -1) { n_remaining = params.n_predict - n_decoded; + } else if (global_params.n_predict == -2) { + n_remaining = n_ctx - n_past; } else if (global_params.n_predict != -1) { n_remaining = global_params.n_predict - n_decoded; }