mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-06-29 20:45:04 +00:00
Fix for main example getting stuck when -n -2 and --interactive (#2767)
* Fix for main example getting stuck when -n -2 and --interactive * Add a comment so future generations may suffer less.
This commit is contained in:
@ -798,7 +798,8 @@ 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 && params.n_predict != -1) {
|
// We skip this logic when n_predict == -1 (infinite) or -2 (stop at context size).
|
||||||
|
if (params.interactive && n_remain <= 0 && params.n_predict >= 0) {
|
||||||
n_remain = params.n_predict;
|
n_remain = params.n_predict;
|
||||||
is_interacting = true;
|
is_interacting = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user