SillyGod
V2EX  ›  问与答

gpt-4-32k 模型 api 的上文 tokens 应该设多少

  •  
  •   SillyGod · Jun 25, 2023 · 1326 views
    This topic created in 1054 days ago, the information mentioned may be changed or developed.
    如果我没理解错误的话

    32k 指的是输入+输出最大为 32k 吧

    那我历史+新提问 的 tokens 或许设置为 16k 比较好?

    假设我历史记录无限多,要是设置成 32k ,他岂不是没得输出喽?

    亦或者其实他输入也有个限制,比如 16k ?
    3 replies    2023-06-25 10:13:59 +08:00
    swulling
        1
    swulling  
       Jun 25, 2023 via iPhone
    自己手动切历史记录或者用 API 对历史记录进行 summary
    kaichen
        2
    kaichen  
    PRO
       Jun 25, 2023
    你如果用的 langchain 来做,可以直接用他的 memory 类,想简单限制数量就用 ConversationTokenBufferMemory ,想做总结再来回交互用 ConversationSummaryBufferMemory

    记录的持久化也能处理

    https://api.python.langchain.com/en/latest/modules/memory.html
    SillyGod
        3
    SillyGod  
    OP
       Jun 25, 2023
    @kaichen 我没用过 langchain ,你在使用中碰到过 bug 嘛
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3023 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 15:17 · PVG 23:17 · LAX 08:17 · JFK 11:17
    ♥ Do have faith in what you're doing.