Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support gpt-4o #1431

Merged
merged 1 commit into from
May 20, 2024
Merged

Conversation

WqyJh
Copy link
Contributor

@WqyJh WqyJh commented May 14, 2024

close #1430

我已确认该 PR 已自测通过,相关截图如下:
(此处放上测试通过的截图,如果不涉及前端改动或从 UI 上无法看出,请放终端启动成功的截图)
image

image

@plusye
Copy link
Contributor

plusye commented May 14, 2024

gpt-4o 的 tokenizer 改为 o200k_base 了,之前的 gpt-4 系列用的是 cl100k_base,gpt-4o 计算 token 的方式不一样了:
openai/tiktoken@9d01e56

@shengxiagit
Copy link

gpt-4o 的 tokenizer 改为 o200k_base 了,之前的 gpt-4 系列用的是 cl100k_base,gpt-4o 计算 token 的方式不一样了: openai/tiktoken@9d01e56

新的token计算方式能降低不少token消耗

@WqyJh
Copy link
Contributor Author

WqyJh commented May 15, 2024

看起来要等待 go-openai 支持 o200k_base

pkoukk/tiktoken-go#47

@WqyJh
Copy link
Contributor Author

WqyJh commented May 15, 2024

主要是中、日、韩语言的token数减少,字母文字几乎不变。

https://github.com/pkoukk/tiktoken-go/blob/b660fb8b24585eb859a9bf13f1dd14c7b83de45b/doc/test_result.md

@ShinChven
Copy link
Contributor

现在token是 one-api 算的,还是 openai 那边算的?

@WqyJh
Copy link
Contributor Author

WqyJh commented May 19, 2024

stream模式是oneapi算的

@songquanpeng songquanpeng merged commit 2457d00 into songquanpeng:main May 20, 2024
@songquanpeng
Copy link
Owner

Thx~

mxdlzg pushed a commit to mxdlzg/one-api that referenced this pull request May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

为OpenAI 最新的GPT-4o模型提供支持
5 participants