-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset context instead of quitting in interactive mode #145
Comments
@ggerganov Please,Thanks! |
it's currently on |
think this relates to #23 but not exactly the same |
I'm on an attempt to fix the diff --git a/main.cpp b/main.cpp
index ca0fca8..126e53f 100644
--- a/main.cpp
+++ b/main.cpp
@@ -991,6 +991,14 @@ int main(int argc, char ** argv) {
fflush(stdout);
}
+ // check for [end of text]
+ if (params.interactive && embd.back() == 2) {
+ fprintf(stderr, " [end of text]\n");
+ // insert the antiprompt to continue the conversation.
+ // however, after this it seems like everything was lost.
+ embd_inp.insert(embd_inp.end(), antiprompt_inp.begin(), antiprompt_inp.end());
+ }
+
// in interactive mode, and not currently processing queued inputs;
// check if we should prompt the user for more
if (params.interactive && embd_inp.size() <= input_consumed) {
@@ -1037,7 +1045,7 @@ int main(int argc, char ** argv) {
}
// end of text token
- if (embd.back() == 2) {
+ if (!params.interactive && embd.back() == 2) {
fprintf(stderr, " [end of text]\n");
break;
} However, it looks like the context is broken when resuming the conversation after the |
Thank you for using llama.cpp and thank you for sharing your feature request. While you've provided valuable feedback on UX improvements, it overlaps a lot with what's being discussed in #23, and right now my top priority is to solve this issue by fixing the underlying technical issue described in #91. Please use those other issues for further discussion, which will reach a broader audience of folks following it. |
It's really annoying that I have to restart the program every time it quits by [end of text] or exceeding context limits, as I need to reload model, which is inefficient.
Is there any way to add an option that instead of quitting just resets to the initial prompt?
The text was updated successfully, but these errors were encountered: