Skip to content

Commit

Permalink
lookahead : support -n -1 infinite generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Nov 26, 2023
1 parent 9656026 commit 3e73d31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/lookahead/lookahead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 3e73d31

Please sign in to comment.