Improve interactive mode's coherence after EOS
Aims to improve coherence and ability to resume the interactive session when the user is given input back after an end of text token is reached. Not sure what token 13 is or why it seems to help. See conversation for examples.
This commit is contained in:
parent
074bea2eb1
commit
4fe9734e09
1 changed files with 2 additions and 0 deletions
2
main.cpp
2
main.cpp
|
@ -1084,6 +1084,8 @@ int main(int argc, char ** argv) {
|
||||||
if (embd.back() == EOS_TOKEN_ID) {
|
if (embd.back() == EOS_TOKEN_ID) {
|
||||||
if (params.interactive) {
|
if (params.interactive) {
|
||||||
is_interacting = true;
|
is_interacting = true;
|
||||||
|
embd.back() = 13;
|
||||||
|
last_n_tokens.back() = 13;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, " [end of text]\n");
|
fprintf(stderr, " [end of text]\n");
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue