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.87k stars 1.32k forks source link

GPT-4o support #577

Open akurou opened 1 month ago

akurou commented 1 month ago

GPT-4o support is not working properly. Reason: tiktoken encoding needs to be updated for GPT-4o.

Currently encoding = tiktoken.get_encoding("gpt-3.5-turbo") is used (openai_helper.py row 656). You need to change tokenizer to "p50k_base" to fix an error.

VaMPIRESqq commented 3 weeks ago

hi, I found a solution to our problem, change line 656 in bot/openai_helper.py to:

encoding = tiktoken.get_encoding("p50k_base")

don't forget about the tabulation rules