-
Hi, it's me again (I'm sorry if I asked too many questions...) Here's what I've tried:
The reason I limitted the context size to 512 is to speed up the process so that the context shift happens earlier in the conversation. The conversation itself is short exchanges and pleasantries, but when context shift happens, it always results in this error:
I've tried several times by increasing the context size, but still the context shift results in this error.
If it matters, I'm using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The purpose of the context shift is to free space from the context sequence to make room for the next generation, so it only happens when the context sequence is full. The reason you pass You can use another context sequence to summarize messages in the current chat for the context shift. I see that I haven't added a section for implementing a custom context shift function, so I'll try to get to it soon to make it easier to use. Let me know whether this helped you. |
Beta Was this translation helpful? Give feedback.
The purpose of the context shift is to free space from the context sequence to make room for the next generation, so it only happens when the context sequence is full.
LlamaChat
andLlamaChatSession
attempt to use the existing context state as much as possible to avoid redundant context shifts, which is why you have to passlastContextWindow
.The reason you pass
lastContextShiftMetadata
is to make it easier for the context shift algorithm to do the next context shift.Every time the context shift function is called, it gets the full chat history, and the number of tokens the "rendered" chat state needs to fit - you can use the chat wrapper's
generateContextState
function to get the "rende…