Closed xiaoToby closed 7 months ago
没遇到,用 yi 官方 key 正常使用,
没遇到,用 yi 官方 key 正常使用,
这是报错日志
没遇到,用 yi 官方 key 正常使用,
我用oneapi测试没有问题,在fastgpt中使用就有问题
没遇到,用 yi 官方 key 正常使用,
我用oneapi测试没有问题,在fastgpt中使用就有问题
你测过流了?只测了非流吧
什么是流和非流?
什么是流和非流?
就是stream=true/fasle的模式,oneapi测试默认是false,你得手动发起curl请求或者使用apifox之类去测试stream模式。
看报错是你的pad_token_id判定出了问题,可以检查一下你用的是yi的哪个模型,去看一下最大支持了多少max_new_tokens ,是不是在界面上选的回复上限太大了,超过了这个
看报错是你的pad_token_id判定出了问题,可以检查一下你用的是yi的哪个模型,去看一下最大支持了多少max_new_tokens ,是不是在界面上选的回复上限太大了,超过了这个
用的是01-ai/Yi-6B-Chat-8bits; 在我openapi文件中使用的max_new_tokens=256,在fastgpt应用》高级编排》AI配置中更改了回复上线<256后,可以使用了 那意思是我应该在我的openapi中将max_new_tokens的数值设置更大? @nongmo677
看报错是你的pad_token_id判定出了问题,可以检查一下你用的是yi的哪个模型,去看一下最大支持了多少max_new_tokens ,是不是在界面上选的回复上限太大了,超过了这个
用的是01-ai/Yi-6B-Chat-8bits; 在我openapi文件中使用的max_new_tokens=256,在fastgpt应用》高级编排》AI配置中更改了回复上线<256后,可以使用了 那意思是我应该在我的openapi中将max_new_tokens的数值设置更大? @nongmo677
@xiaoToby 应该说,你的参数不太对,fastgpt对接的最多是openai 的api或者是一些开源项目仿openai api接口,没有叫做max_new_tokens
的参数,正确的参数叫做max_tokens
,所以你调整fastgpt的回复上限的时候就会正确了。其次,从https://huggingface.co/01-ai/Yi-6B-Chat-8bits/blob/main/tokenizer_config.json 提供的文件来看,最大应该是支持4096。
结论:你直接调max_new_tokens的大小也行,但是建议用映射的方式,还是要动态接收fastgpt传过来的openai apic参数,建议你还是用一些别的项目部署
2024-08-05 00:42:54 [Warn] 2024-08-04 16:42:54 LLM response error {"requestBody":{"model":"llamazk:latest","temperature":0.36,"max_tokens":2000,"stream":true,"messages":[{"role":"system","content":"回答要用中文,要有语义符号分断!"},{"role":"user","content":"你是谁"}]}} 2024-08-05 00:42:54 [Error] 2024-08-04 16:42:54 sse error: LLM model response empty 2024-08-05 00:41:55 { 2024-08-05 00:41:55 message: 'LLM model response empty', 2024-08-05 00:41:55 stack: 'Error: LLM model response empty\n' + 2024-08-05 00:41:55 ' at /app/projects/app/.next/server/chunks/96960.js:318:790\n' + 2024-08-05 00:41:55 ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + 2024-08-05 00:41:55 ' at async Object.q [as chatNode] (/app/projects/app/.next/server/chunks/96960.js:318:645)\n' + 2024-08-05 00:41:55 ' at async k (/app/projects/app/.next/server/chunks/96960.js:319:2662)\n' + 2024-08-05 00:41:55 ' at async Promise.all (index 0)\n' + 2024-08-05 00:41:55 ' at async C (/app/projects/app/.next/server/chunks/96960.js:319:3248)\n' + 2024-08-05 00:41:55 ' at async v (/app/projects/app/.next/server/pages/api/core/chat/chatTest.js:1:7066)\n' + 2024-08-05 00:41:55 ' at async /app/projects/app/.next/server/pages/api/core/app/detail.js:1:5511\n' + 2024-08-05 00:41:55 ' at async K (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)\n' + 2024-08-05 00:41:55 ' at async U.render (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)' 2024-08-05 00:41:55 } 2024-08-05 00:42:54 { 2024-08-05 00:42:54 message: 'LLM model response empty', 2024-08-05 00:42:54 stack: 'Error: LLM model response empty\n' + 2024-08-05 00:42:54 ' at /app/projects/app/.next/server/chunks/96960.js:318:790\n' + 2024-08-05 00:42:54 ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + 2024-08-05 00:42:54 ' at async Object.q [as chatNode] (/app/projects/app/.next/server/chunks/96960.js:318:645)\n' + 2024-08-05 00:42:54 ' at async k (/app/projects/app/.next/server/chunks/96960.js:319:2662)\n' + 2024-08-05 00:42:54 ' at async Promise.all (index 0)\n' + 2024-08-05 00:42:54 ' at async C (/app/projects/app/.next/server/chunks/96960.js:319:3248)\n' + 2024-08-05 00:42:54 ' at async v (/app/projects/app/.next/server/pages/api/core/chat/chatTest.js:1:7066)\n' + 2024-08-05 00:42:54 ' at async /app/projects/app/.next/server/pages/api/core/app/detail.js:1:5511\n' + 2024-08-05 00:42:54 ' at async K (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)\n' + 2024-08-05 00:42:54 ' at async U.render (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)' 2024-08-05 00:42:54 } 2024-08-05 00:43:52 { 2024-08-05 00:43:52 message: 'LLM model response empty', 2024-08-05 00:43:52 stack: 'Error: LLM model response empty\n' + 2024-08-05 00:43:52 ' at /app/projects/app/.next/server/chunks/96960.js:318:790\n' + 2024-08-05 00:43:52 ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + 2024-08-05 00:43:52 ' at async Object.q [as chatNode] (/app/projects/app/.next/server/chunks/96960.js:318:645)\n' + 2024-08-05 00:43:52 ' at async k (/app/projects/app/.next/server/chunks/96960.js:319:2662)\n' + 2024-08-05 00:43:52 ' at async Promise.all (index 0)\n' + 2024-08-05 00:43:52 ' at async C (/app/projects/app/.next/server/chunks/96960.js:319:3248)\n' + 2024-08-05 00:43:52 ' at async v (/app/projects/app/.next/server/pages/api/core/chat/chatTest.js:1:7066)\n' + 2024-08-05 00:43:52 ' at async /app/projects/app/.next/server/pages/api/core/app/detail.js:1:5511\n' + 2024-08-05 00:43:52 ' at async K (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)\n' + 2024-08-05 00:43:52 ' at async U.render (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)' 2024-08-05 00:43:52 } 2024-08-05 00:45:00 { 2024-08-05 00:45:00 message: 'LLM model response empty', 2024-08-05 00:45:00 stack: 'Error: LLM model response empty\n' + 2024-08-05 00:45:00 ' at /app/projects/app/.next/server/chunks/96960.js:318:790\n' + 2024-08-05 00:45:00 ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + 2024-08-05 00:45:00 ' at async Object.q [as chatNode] (/app/projects/app/.next/server/chunks/96960.js:318:645)\n' + 2024-08-05 00:45:00 ' at async k (/app/projects/app/.next/server/chunks/96960.js:319:2662)\n' + 2024-08-05 00:45:00 ' at async Promise.all (index 0)\n' + 2024-08-05 00:45:00 ' at async C (/app/projects/app/.next/server/chunks/96960.js:319:3248)\n' + 2024-08-05 00:45:00 ' at async J (/app/projects/app/.next/server/pages/api/v1/chat/completions.js:63:12278)\n' + 2024-08-05 00:45:00 ' at async /app/projects/app/.next/server/pages/api/core/app/detail.js:1:5511\n' + 2024-08-05 00:45:00 ' at async K (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)\n' + 2024-08-05 00:45:00 ' at async U.render (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)' 2024-08-05 00:45:00 } 2024-08-05 00:45:36 { 2024-08-05 00:45:36 message: 'LLM model response empty', 2024-08-05 00:45:36 stack: 'Error: LLM model response empty\n' + 2024-08-05 00:45:36 ' at /app/projects/app/.next/server/chunks/96960.js:318:790\n' + 2024-08-05 00:45:36 ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + 2024-08-05 00:45:36 ' at async Object.q [as chatNode] (/app/projects/app/.next/server/chunks/96960.js:318:645)\n' + 2024-08-05 00:45:36 ' at async k (/app/projects/app/.next/server/chunks/96960.js:319:2662)\n' + 2024-08-05 00:45:36 ' at async Promise.all (index 0)\n' + 2024-08-05 00:45:36 ' at async C (/app/projects/app/.next/server/chunks/96960.js:319:3248)\n' + 2024-08-05 00:45:36 ' at async J (/app/projects/app/.next/server/pages/api/v1/chat/completions.js:63:12278)\n' + 2024-08-05 00:45:36 ' at async /app/projects/app/.next/server/pages/api/core/app/detail.js:1:5511\n' + 2024-08-05 00:45:36 ' at async K (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)\n' + 2024-08-05 00:45:36 ' at async U.render (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)' 2024-08-05 00:45:36 } 2024-08-05 00:50:30 { 2024-08-05 00:50:30 message: 'LLM model response empty', 2024-08-05 00:50:30 stack: 'Error: LLM model response empty\n' + 2024-08-05 00:50:30 ' at /app/projects/app/.next/server/chunks/96960.js:318:790\n' + 2024-08-05 00:50:30 ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + 2024-08-05 00:50:30 ' at async Object.q [as chatNode] (/app/projects/app/.next/server/chunks/96960.js:318:645)\n' + 2024-08-05 00:50:30 ' at async k (/app/projects/app/.next/server/chunks/96960.js:319:2662)\n' + 2024-08-05 00:50:30 ' at async Promise.all (index 0)\n' + 2024-08-05 00:50:30 ' at async C (/app/projects/app/.next/server/chunks/96960.js:319:3248)\n' + 2024-08-05 00:50:30 ' at async J (/app/projects/app/.next/server/pages/api/v1/chat/completions.js:63:12278)\n' + 2024-08-05 00:50:30 ' at async /app/projects/app/.next/server/pages/api/core/app/detail.js:1:5511\n' + 2024-08-05 00:50:30 ' at async K (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)\n' + 2024-08-05 00:50:30 ' at async U.render (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)' 2024-08-05 00:50:30 } 2024-08-05 00:50:34 { 2024-08-05 00:50:34 message: 'LLM model response empty', 2024-08-05 00:50:34 stack: 'Error: LLM model response empty\n' + 2024-08-05 00:50:34 ' at /app/projects/app/.next/server/chunks/96960.js:318:790\n' + 2024-08-05 00:50:34 ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + 2024-08-05 00:50:34 ' at async Object.q [as chatNode] (/app/projects/app/.next/server/chunks/96960.js:318:645)\n' + 2024-08-05 00:50:34 ' at async k (/app/projects/app/.next/server/chunks/96960.js:319:2662)\n' + 2024-08-05 00:50:34 ' at async Promise.all (index 0)\n' + 2024-08-05 00:50:34 ' at async C (/app/projects/app/.next/server/chunks/96960.js:319:3248)\n' + 2024-08-05 00:50:34 ' at async J (/app/projects/app/.next/server/pages/api/v1/chat/completions.js:63:12278)\n' + 2024-08-05 00:50:34 ' at async /app/projects/app/.next/server/pages/api/core/app/detail.js:1:5511\n' + 2024-08-05 00:50:34 ' at async K (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16853)\n' + 2024-08-05 00:50:34 ' at async U.render (/app/nodemodules/.pnpm/next@14.2.5@babel+core@7.24.9_react-dom@18.3.1_react@18.3.1react@18.3.1_sass@1.77.8/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17492)'
oneapi用pyt程序调用正常返回,但用fastgpt就不行
你贴一下启用yi模型api的py文件
例行检查
你的版本
问题描述 使用one-api测试没问题,但在fastgpt调用时报错 复现步骤 报错日志截图: 200是使用one-api工具调用测试
这是代码部分:
预期结果
相关截图