lookahead : support -n -1 infinite generation

This commit is contained in:
Georgi Gerganov 2023-11-26 21:51:46 +02:00
parent 9656026b53
commit 3e73d31d9c
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

View File

@ -311,7 +311,7 @@ int main(int argc, char ** argv) {
++n_predict;
++n_past;
if (n_predict > params.n_predict || has_eos) {
if ((params.n_predict >= 0 && n_predict > params.n_predict) || has_eos) {
break;
}
@ -433,7 +433,7 @@ int main(int argc, char ** argv) {
}
}
if (n_predict > params.n_predict || has_eos) {
if ((params.n_predict >= 0 && n_predict > params.n_predict) || has_eos) {
break;
}