diff options
author | anzz1 <anzz1@live.com> | 2023-03-26 16:06:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-26 16:06:10 +0300 |
commit | 7a87d31f4f0c37bbb2ea695929fa4fe3ad579cda (patch) | |
tree | b1a6e248b0569a593755e77a9f30c803db3fcdeb | |
parent | 348d6926ee31d4476f9b90e1a627b0925a70f847 (diff) |
[main] fix infinite generation (-n == -1) (#523)
-rw-r--r-- | examples/main/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp index e9478d5..66b7c2d 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; } |