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

令牌计算不正确 #37

Closed
aiastia opened this issue Apr 29, 2023 · 7 comments
Closed

令牌计算不正确 #37

aiastia opened this issue Apr 29, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@aiastia
Copy link

aiastia commented Apr 29, 2023

我发送了一句话 (12个中文 消耗了 网站显示 用了2k的令牌。我用 openai token 计算也才26个

@aiastia
Copy link
Author

aiastia commented Apr 29, 2023

1、另外删除 令牌后 额度 视乎虚无了…
2 删除token 没二次确认 …

@songquanpeng
Copy link
Owner

  1. 我也感觉令牌的消耗有点问题。
  2. 删除令牌后按理说无法使用了才对?难道你删完之后还可以用啊》
  3. 二次确认这个之后加上。

谢谢反馈,稍后处理。

@songquanpeng songquanpeng added the bug Something isn't working label Apr 29, 2023
@aiastia
Copy link
Author

aiastia commented Apr 29, 2023

视乎是夹带了上下文 😅> 我发送了一句话 (12个中文 消耗了 网站显示 用了2k的令牌。我用 openai token 计算也才26个

@aiastia
Copy link
Author

aiastia commented Apr 29, 2023

删除令牌

1。3.5好像是计算发送和上次回复(如果有)的吧。感觉 是吧回复的也计算进去了
2。应该是不能用 ,不过目前系统是有兑换按钮 目前如果 删除 了 兑换的次数不就找不回来了 🤔

@songquanpeng
Copy link
Owner

  1. 是的,会把上下文算进去的,OpenAI 也是这样计费的,所以如果上下文很长是有可能一次消耗很多的。
  2. 是哦,删除后应该把剩余次数返还给用户,我忘记考虑这一点了。

@songquanpeng
Copy link
Owner

我再次测试了一下,token 计算是正确的。
命令 ChatGPT 返回我们的输入,这样可以固定其输出。stream 模式和非 stream 模式下的 token 数一致:
image

@songquanpeng
Copy link
Owner

删除时返还剩余额度已实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants