aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoranzz1 <anzz1@live.com>2023-03-26 16:06:10 +0300
committerGitHub <noreply@github.com>2023-03-26 16:06:10 +0300
commit7a87d31f4f0c37bbb2ea695929fa4fe3ad579cda (patch)
treeb1a6e248b0569a593755e77a9f30c803db3fcdeb /examples
parent348d6926ee31d4476f9b90e1a627b0925a70f847 (diff)
[main] fix infinite generation (-n == -1) (#523)
Diffstat (limited to 'examples')
-rw-r--r--examples/main/main.cpp2
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;
}