microsoft / autogen

A programming framework for agentic AI. Discord: https://aka.ms/autogen-dc. Roadmap: https://aka.ms/autogen-roadmap
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
28.1k stars 4.1k forks source link

Potentially invalid token counting #1164

Open bitnom opened 6 months ago

bitnom commented 6 months ago

Describe the bug

completion_tokens += 1 looks like a bad idea. Do we expect a chunk to always be 1 token? I don't think so.

Steps to reproduce

No response

Expected Behavior

tiktoken

Screenshots and logs

No response

Additional Information

Will fill this out more as I get to it.

rickyloynd-microsoft commented 6 months ago

@kevin666aa fyi

bitnom commented 5 months ago

Some fun links to note for potentially upcoming necessities..

https://pypi.org/project/tiktoken/

https://pypi.org/project/tiktoken-async/

https://pypi.org/project/qwen-cpp/

qingyun-wu commented 2 weeks ago

@yiranwu0 could you take a look at this?