From 4fe9734e0964e9363b7f2367394d8a6f1be09525 Mon Sep 17 00:00:00 2001 From: rabidcopy Date: Mon, 20 Mar 2023 11:33:50 -0500 Subject: [PATCH] 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. --- main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.cpp b/main.cpp index 159033373..16751aa5f 100644 --- a/main.cpp +++ b/main.cpp @@ -1084,6 +1084,8 @@ int main(int argc, char ** argv) { if (embd.back() == EOS_TOKEN_ID) { if (params.interactive) { is_interacting = true; + embd.back() = 13; + last_n_tokens.back() = 13; } else { fprintf(stderr, " [end of text]\n"); break;