book-by-ai icon indicating copy to clipboard operation
book-by-ai copied to clipboard

中文 - gpt3.5-16k模型 - 出现token超出的情况

Open Jungley8 opened this issue 1 year ago • 2 comments

Error: ChatGPT error 400: {
  "error": {
    "message": "This model's maximum context length is 16385 tokens. However, your messages resulted in 19500 tokens. Please reduce the length of the messages.",
    "type": "invalid_request_error",
    "param": "messages",
    "code": "context_length_exceeded"
  }
}

    at fetchSSE (/node_modules/api2d/cjs/fetchSSE.js:16:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /node_modules/api2d/cjs/index.js:147:38 {

Jungley8 avatar Aug 14 '23 13:08 Jungley8

因为我主要用 claude 100K,因此没有对字数做限制。你可以手工限制下字数。16k的话,8000字应该就可以。 https://github.com/easychen/book-by-ai/blob/d57731500d6fe56568bfe7ac40fc5326e5c45b67/actions/book_cn.js#L251

easychen avatar Aug 14 '23 13:08 easychen

具体怎么改啊兄弟,小白有点看不懂

wangshipei avatar Aug 15 '23 07:08 wangshipei