server: handle n_predict==2 error

This commit is contained in:
zhenweijin 2024-10-18 18:06:19 +08:00
parent 87421a23e8
commit 63978cb6dc

View File

@ -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;
}