Respect the maximum number of tokens in interactive.
This commit is contained in:
parent
084e2f0ec0
commit
9d89bedf1a
1 changed files with 7 additions and 1 deletions
8
main.cpp
8
main.cpp
|
@ -1055,7 +1055,7 @@ int main(int argc, char ** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// end of text token
|
// end of text token
|
||||||
if (embd.back() == 2) {
|
if (embd.size() && embd.back() == 2) {
|
||||||
if (params.interactive) {
|
if (params.interactive) {
|
||||||
is_interacting = true;
|
is_interacting = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1063,6 +1063,12 @@ int main(int argc, char ** argv) {
|
||||||
break;
|
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)
|
#if defined (_WIN32)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue