Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure OpenAI 使用 gpt-3.5-turbo-1106 测速失败 #67

Closed
5 tasks done
zengbo opened this issue Feb 14, 2024 · 3 comments · Fixed by #68
Closed
5 tasks done

Azure OpenAI 使用 gpt-3.5-turbo-1106 测速失败 #67

zengbo opened this issue Feb 14, 2024 · 3 comments · Fixed by #68
Labels
bug Something isn't working

Comments

@zengbo
Copy link

zengbo commented Feb 14, 2024

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,尤其是常见问题部分
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

问题描述
渠道中设置测速模型为 gpt-3.5-turbo-1106 或者 gpt-35-turbo-1106 均出现报错
复现步骤

  1. Azure OpenAI 中设置 deployment name 为 gpt-35-turbo-1106
  2. One API 中添加渠道,设置 gpt-3.5-turbo-1106 测速模型
  3. 测速

预期结果
不报错,测速正常

相关截图
CleanShot 2024-02-14 at 19 22 05@2x

CleanShot 2024-02-14 at 19 20 15@2x

@zengbo zengbo added the bug Something isn't working label Feb 14, 2024
@MartialBE
Copy link
Owner

这是因为Azure OpenAI,我做了一层处理,在请求接口的时候,如果模型名称是以四个数字结尾的,将会自动去除。
比如 gpt-3.5-turbo-1106 在请求的时候,事实上是请求的gpt-3.5-turbo
这是因为Azure OpenAI 之前一个模型只能部署一次,所以为了方便,可以不做任何映射,直接在Azure OpenAI Studio更改部署版本就可以将所有的gpt-3.5-turbo-xxx直接指向gpt-3.5-turbo

相关代码:
https://github.com/MartialBE/one-api/blob/9ccce8de9795f5ebc01fc14a1fa6565debc37473/providers/openai/base.go#L88-L96

@zengbo
Copy link
Author

zengbo commented Feb 17, 2024

这是因为Azure OpenAI,我做了一层处理,在请求接口的时候,如果模型名称是以四个数字结尾的,将会自动去除。 比如 gpt-3.5-turbo-1106 在请求的时候,事实上是请求的gpt-3.5-turbo。 这是因为Azure OpenAI 之前一个模型只能部署一次,所以为了方便,可以不做任何映射,直接在Azure OpenAI Studio更改部署版本就可以将所有的gpt-3.5-turbo-xxx直接指向gpt-3.5-turbo

相关代码:

https://github.com/MartialBE/one-api/blob/9ccce8de9795f5ebc01fc14a1fa6565debc37473/providers/openai/base.go#L88-L96

这样的处理方式一般情况下没有啥问题,但是因为 gpt-3.5-turbo 不同版本,max token 是不一样的,有的程序会根据 gpt-3.5-turbo 的名字来做不同的处理,这个时候把 gpt-3.5-turbo-xxx直接指向gpt-3.5-turbo 是有问题的。

@MartialBE
Copy link
Owner

明白你的意思。
可能恢复以前使用映射比较好。
只不过现在的模型映射也是有点问题的,A映射到B,在日志和计费上都是显示的B,这样给用户也会带来困扰。
后期我准备将映射设置改为在请求供应商API时进行替换,这样在计费和日志中显示的都是用户实际请求模型。

你有什么更好的建议也可以提出来~

目前你可以fork代码将上面的代码删除后编译使用。也可以将azure的模型名称更改为非4位数字后缀的暂时使用。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants