Skip to content
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

Better chat history management #101

Closed
rchan26 opened this issue Sep 21, 2023 · 3 comments · Fixed by #125
Closed

Better chat history management #101

rchan26 opened this issue Sep 21, 2023 · 3 comments · Fixed by #125
Assignees
Labels
bug Something isn't working

Comments

@rchan26
Copy link
Collaborator

rchan26 commented Sep 21, 2023

With the llama-cpp model, after a few chat interactions, we may come across a ValueError('Requested tokens (...) exceed context window of 4096') error. Any messages after this will be responded with an AssertionError() (this is because in llama-index's messages_to_prompt function, it expects it to have alternating user and assistant chat messages and has assert statements to check this).

Note that we can avoid this by clearing the chat history by implementing a Slack shortcut (see #97), but maybe a better way to do this is that we start dropping old chat history to make sure there is enough space and not error out. Essentially have some automatic forgetting.

Maybe this change occurs in llama-index rather than here, but something to consider.

@rchan26 rchan26 self-assigned this Sep 21, 2023
@rchan26 rchan26 added the bug Something isn't working label Sep 22, 2023
@rchan26
Copy link
Collaborator Author

rchan26 commented Sep 27, 2023

Related to #97

@rchan26
Copy link
Collaborator Author

rchan26 commented Nov 1, 2023

I think this should be fixed now with this PR into llama-index: run-llama/llama_index#8530. Need to bump version of llama-index (I'll do this today)

@rchan26
Copy link
Collaborator Author

rchan26 commented Nov 1, 2023

we'll keep the ability to clear chat history just in case and also if the user wants to manually start a new conversation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant