Closed soctib closed 1 year ago
I think I see the issue. https://github.com/YenRaven/annoy_ltm/blob/bfac65383f68c154a2f4bd9fa4e4bd03c1b23f11/script.py#LL657C1-L658C43
while len(rows) > min_rows and len(encode(''.join(rows))[0]) >= max_length:
rows.pop(3 + len(memory_rows))
This code is meant to ensure the prompt doesn't overflow the max prompt length of your model. I could see that it's possible if your memory is too long, that it tries to remove all of the chat context from the prompt. Is it possible you have adjusted your settings for this extension? Possibly setting memory to chat ratio to a higher value?
I made no adjustments on the settings of annoy itself. It seems to happen once prompt + chat together have a certain length.
@soctib Would you be willing to check out the branch for the fix ☝️ and see if it fixes the issue?
Tested fix from #14 and it is not creating a new issue, so I will close this issue with that merge for now. If you still experience this issue, please leave a comment for me to re-open it.
Sorry for the delay. I can confirm all errors are gone.
I wasn't able to narrow this one down to any specific cause, but my guess is that it is somehow related with the text generated by the bot: