diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1062,7 +1062,6 @@ int main(int argc, char ** argv) { } // end of text token - if (embd.back() == EOS_TOKEN_ID) { if (params.interactive) { is_interacting = true; @@ -1071,6 +1070,12 @@ int main(int argc, char ** argv) { break; } } + + // In interactive mode, respect the maximum number of tokens and drop back to user input when reached. + if (params.interactive && remaining_tokens <= 0) { + remaining_tokens = params.n_predict; + is_interacting = true; + } } #if defined (_WIN32) |