MartialBE / one-api

OpenAI 接口管理 & 分发系统,改自songquanpeng/one-api。支持更多模型,加入统计页面,完善非openai模型的函数调用。
https://one-api-martialbe.vercel.app/
Apache License 2.0
814 stars 166 forks source link

百度文心模型调用异常 #208

Closed soulgod001 closed 1 month ago

soulgod001 commented 1 month ago

例行检查

问题描述 在使用百度文心的Lite-8k,Speed-128K,Tiny-8k时报错,显示不支持OpenAi的method Speed使用正常但日志会报错

[GIN] 2024/05/23 - 10:45:06 | 20240523104506443517228B6t7zlmU | 204 | 285.622µs | 114.87.1.151 | OPTIONS /v1/chat/completions
[SYS] 2024/05/23 - 10:45:06 | failed to get token encoder for model ERNIE-Lite-8K: no encoding for model ERNIE-Lite-8K, using encoder for gpt-3.5-turbo
[ERR] 2024/05/23 - 10:45:07 | 20240523104506707831739BnSNwsQp | relay error happen, status code is 200, won't retry in this case
[ERR] 2024/05/23 - 10:45:07 | 20240523104506707831739BnSNwsQp | relay error (channel #12(百度官方)): Provider API error: Unsupported openapi method
[GIN] 2024/05/23 - 10:45:07 | 20240523104506707831739BnSNwsQp | 200 | 313.53509ms | 114.87.1.151 | POST /v1/chat/completions
[GIN] 2024/05/23 - 10:45:07 | 202405231045075603042038ijJMPLr | 204 | 40.385µs | 114.87.1.151 | OPTIONS /v1/chat/completions
[GIN] 2024/05/23 - 10:45:31 | 20240523104507836249703CGCYUqph | 200 | 23.285424246s | 114.87.1.151 | POST /v1/chat/completions
[INFO] 2024/05/23 - 10:45:31 | 20240523104507836249703CGCYUqph | record consume log: userId=1, channelId=7, promptTokens=88, completionTokens=11, modelName=gpt-3.5-turbo, tokenName=Lobe-Chat, quota=31, content=模型费率 $0.0005/1k (输入) | $0.0015/1k (输出),分组倍率 1.00
[GIN] 2024/05/23 - 10:46:44 | 20240523104644665714840Nz6rZ0Zp | 204 | 436.801µs | 114.87.1.151 | OPTIONS /v1/chat/completions
[SYS] 2024/05/23 - 10:46:46 | failed to get token encoder for model ERNIE-Speed: no encoding for model ERNIE-Speed, using encoder for gpt-3.5-turbo
[GIN] 2024/05/23 - 10:46:46 | 2024052310464684605728EZRz40jZ | 200 | 838.708844ms | 114.87.1.151 | POST /v1/chat/completions
[INFO] 2024/05/23 - 10:46:46 | 2024052310464684605728EZRz40jZ | record consume log: userId=1, channelId=12, promptTokens=1, completionTokens=16, modelName=ERNIE-Speed, tokenName=Lobe-Chat, quota=0, content=模型费率 $0/1k,分组倍率 1.00

复现步骤 对接百度官方渠道

预期结果 能够正常调用 相关截图 image

MartialBE commented 1 month ago
  1. 百度的新模型,还没发版。 现在已经发版了,等待编译完成后更新即可。
  2. failed to get token encoder for model ERNIE-Speed: no encoding for model ERNIE-Speed, using encoder for gpt-3.5-turbo 这个报错是只没有找到这个模型的tokens计算,可以无视