Coder Social home page Coder Social logo

Comments (2)

zhujunsan avatar zhujunsan commented on May 19, 2024 1

TL;DR: 会。


token 统计显示样式为 ~ xxx + yyy = zzz

其中这三个数字都是上游的 api 依赖库提供的(which 核对下来 xxx 的计算略有出入,少了一些前后包装,我已经提代码了)

~ 是预估,因为上游的依赖库是自己算的不是根据 openai 的返回来算的

xxx 是 prompt 的 token 数,含上下文,至于含多少上下文,这个取决于上游 api 依赖库自己的设定,其实本项目没有控制

yyy 是 response 的 token 数,这个实测下来是准的

zzz 就是两者相加

from chatgpt-web.

huangwb8 avatar huangwb8 commented on May 19, 2024

@xlzy520

确切地说是token统计。 这取决你使用什么模式。

Kerwin1202/chatgpt-web 中, 对话框左侧有一个时钟按钮,可以控制下一次对话时是否包括之前的所有对话。 红不包括,绿则包括。 最新版本也支持对话的token消耗了,你也可以测试一下是不是这样。

另外,我个人的习惯时,短对话时使用API;长对话使用access token。 因此,我其实是安装了2个docker stack。 感觉还是挺不错的 (ฅ´ω`ฅ)

具体可见我的教程: Docker系列 基于OpenAI API和Access Token自建ChatGPT

from chatgpt-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.