Closed leohpark closed 6 months ago
Hey thanks for commenting. To answer a few of your concerns:
decode
back and a bug was occurring where extra characters were getting inserted that caused the chat completion API to give wildly wrong answers. So I hardcoded it for nowthanks for the response, makes sense. I'm pretty sure I've run into tiktoken bugs too, and they nearly drove me mad.
It seems like there is not any pressing need on this so I am closing it out
Hello from linkedin!
I noticed the following function appears to assume the user will use one of ["gpt-4", "gpt-4-32k", "or gpt-3.5-turbo-16k"], and otherwise make some assumptions about model context limits (defaults to gpt-4), and returns a portion of document[] as a function of remaining_tokens. Assuming people are using the 1106 models, is this function still doing what is intended?
additionally, I would suggest using a proper text splitter tool in order to return a more precise slice of the document based on actual token count. There are examples at both extremes where tokens-per-character is not near the assumed values of 3 and 4.