Co-authored-by: Johnman <redacted>
Co-authored-by: Georgi Gerganov <redacted>
}
// end of text token
-
if (embd.back() == EOS_TOKEN_ID) {
if (params.interactive) {
is_interacting = true;
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)