mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-11-11 21:39:52 +00:00
[main] fix infinite generation (-n == -1) (#523)
This commit is contained in:
parent
348d6926ee
commit
7a87d31f4f
@ -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.
|
// 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;
|
n_remain = params.n_predict;
|
||||||
is_interacting = true;
|
is_interacting = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user