n3d1117 / chatgpt-telegram-bot

🤖 A Telegram bot that integrates with OpenAI's official ChatGPT APIs to provide answers, written in Python
GNU General Public License v2.0
2.89k stars 1.32k forks source link

Unknown encoding gpt-3.5-turbo. Plugins found: ['tiktoken_ext.openai_public'] #609

Open delfer opened 4 days ago

delfer commented 4 days ago

Bug in https://github.com/n3d1117/chatgpt-telegram-bot/blob/0.4.1/bot/openai_helper.py#L656

        try:
            encoding = tiktoken.encoding_for_model(model)
        except KeyError:
            encoding = tiktoken.get_encoding("gpt-3.5-turbo")

Must be

        try:
            encoding = tiktoken.encoding_for_model(model)
        except KeyError:
            encoding = tiktoken.get_encoding("cl100k_base")
delfer commented 3 days ago

fixed in https://github.com/n3d1117/chatgpt-telegram-bot/pull/615