-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Never exit the main loop in interactive mode. #297
Conversation
If the end of stream token mark is found, when in interactive mode, ask for user input instead of exiting the main loop. In case of running out of token budget, reset it and ask for user input. With these changes, embd can end up empty and cause a crash in the next iteration of the loop, so we check for its size as well.
So if I'm understanding this right, this PR handles both the end of text token AND the exit that occurs when you run out of tokens/context? Where exactly is the "memory" left after that? Does it reset and behave like you just started your initial prompt again with no user input/response history or? Sorry if this is obvious. Edit: Very useful nonetheless. Seems to work. Beats having to reload the model and have the initial prompt parsed again. |
It shouldn’t affect the memory. It just resets the counter that holds how many tokens it can generate before reaching the maximum specified in the parameters. However, I did a mess with the commits. Perhaps this pull request should be rejected and done properly again. I don’t know if the mess can be fixed manually now. I have little experience with pull requests, sorry. |
Yep. I messed up and included changes from other stuff I was working on. |
This is a bit sloppy and hacked together and the
|
Made a proper pull request with just the necessary changes. |
…cpp-repro Update bug_report.md
If the end of stream token mark is found, when in interactive mode, ask for user input instead of exiting the main loop.
In case of running out of token budget, reset it and ask for user input.
With these changes, embd can end up empty and cause a crash in the next iteration of the loop, so we check for its size as well.