From: anzz1 Date: Sun, 26 Mar 2023 13:06:10 +0000 (+0300) Subject: [main] fix infinite generation (-n == -1) (#523) X-Git-Tag: gguf-v0.4.0~1092 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=7a87d31f4f0c37bbb2ea695929fa4fe3ad579cda;p=pkg%2Fggml%2Fsources%2Fllama.cpp [main] fix infinite generation (-n == -1) (#523) --- diff --git a/examples/main/main.cpp b/examples/main/main.cpp index e9478d54..66b7c2d5 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -493,7 +493,7 @@ int main(int argc, char ** argv) { } // In interactive mode, respect the maximum number of tokens and drop back to user input when reached. - if (params.interactive && n_remain <= 0) { + if (params.interactive && n_remain <= 0 && params.n_predict != -1) { n_remain = params.n_predict; is_interacting = true; }