lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
44.11k stars 9.86k forks source link

[Bug] GPT4o上传图片不会计算图片的token #2844

Closed sonnyding1 closed 3 months ago

sonnyding1 commented 4 months ago

📦 Environment

📌 Version

v0.162.21

💻 Operating System

🌐 Browser

🐛 Bug Description

使用GPT4o上传图片时,lobechat不会计算图片的token count,只会计算文字的token count。

📷 Recurrence Steps

如图,在写了图片和文字+role setting后只显示用了47个token。GPT回答以后共有132个token,但是这并不包括图片的token数。因为GPT的回答

This image is a Google Doodle. Google Doodles are special, temporary alterations of the logo on Google's homepage intended to celebrate holidays, events, achievements, and notable historical figures. This particular Doodle features a dragon boat, which is often associated with the Dragon Boat Festival, a traditional Chinese holiday. The paddlers are rowing the boat, and the water splashes form the word "Google" in the background.

放到tokenizer后正好85个token。85+47=132。

image image

🚦 Expected Behavior

lobechat应该在显示token数量的时候考虑图片使用的token数量。

📝 Additional Information

另外,我没有尝试使用其他LLM上传图片,但是可以测试一下用其他LLM是不是也存在同样的问题。

lobehubbot commented 4 months ago

👀 @sonnyding1

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

arvinxx commented 3 months ago

重复 https://github.com/lobehub/lobe-chat/issues/2713

lobehubbot commented 3 months ago

✅ @sonnyding1

This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。

lobehubbot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Duplicate https://github.com/lobehub/lobe-chat/issues/2713