I am trying to be able to calculate the token count for a piece of text on Python before sending to openai.ChatCompletion.create.
I am using tiktoken package per this article https://platform.openai.com/tokenizer recommendation. However, after some testing, I notice that the result produced by tiktoken does not match with the results I get on the online tokenizer (at https://platform.openai.com/tokenizer), and also doesn't match the response I get from openai.ChatCompletion.create.
After testing around a bit, I realize that tiktoken doesn't encode newlines. Is this a bug, or I configured it incorrectly?
Extra Note: I am targeting gpt-3.5-turbo model.