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

[Bug] access code导致Azure模型不可用 #5560

Open
CharlinChen opened this issue Sep 29, 2024 · 7 comments
Open

[Bug] access code导致Azure模型不可用 #5560

CharlinChen opened this issue Sep 29, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@CharlinChen
Copy link

📦 Deployment Method

Docker

📌 Version

2.5.13

💻 Operating System

Ubuntu

📌 System Version

20.2

🌐 Browser

Firefox

📌 Browser Version

130.0.1

🐛 Bug Description

启动docker时,如果指定了-e CODE='xxx',Azure模型将不可用。
复现步骤:
1.启动docker:

docker run -d \ 
-e OPENAI_API_KEY='xxx' \
-e BASE_URL='xxx' \
-e AZURE_URL=‘https://xxx’ \
-e AZURE_API_KEY='xxx' \
-e AZURE_API_VERSION='xxx' \
-e CODE='xxx'
-e CUSTOM_MODELS='+AzureGPT-3.5@Azure=gpt-3.5-turbo'
webnextimage:latest

2.打开网页,提示输入access code

3.输入正确access code

4.OpenAI 模型服务可用,Azure模型不可用,提示access code错误。

5.启动docker时不设置CODE变量,Azure模型可正常生成内容。

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

@CharlinChen CharlinChen added the bug Something isn't working label Sep 29, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] access code causes Azure model to be unavailable

@ghost

This comment was marked as spam.

@lloydzhou
Copy link
Member

image
你可以参考 #5001 关于custom models的写法。
我想你这里的写法应该是+gpt-3.5-turbo@Azure=AzureGPT-3.5,前面是调用的模型名称,后面是你在Azure上面部署的名称

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


image
You can refer to #5001 for how to write custom models.
I think your writing here should be +gpt-3.5-turbo@Azure=AzureGPT-3.5, the first is the name of the called model, and the second is the name you deployed on Azure.

@iswangyk
Copy link

I have the same issue

@CharlinChen
Copy link
Author

找到原因了,自定义模型和预设模型是冲突的,如果之前填了Azure的api key,即使后面取消了勾选“自定义接口”,这个api key变量依然存在,app/client/api.ts这个文件里的getAuthHeader()方法并没有判断“自定义接口”是否勾选,导致请求头没有Authorization这个变量,最终导致了access code错误。
解决方法是到设置项里,勾选“自定义接口”,选择出现access code的服务,如Azure,再把api key等内容全部删除,再取消勾选“自定义接口”,这样就可以避免使用预设模型的access code错误。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I found the reason. The custom model and the preset model conflict. If you filled in the Azure api key before, even if you uncheck "Custom Interface" later, the api key variable still exists, app/client/api.ts The getAuthHeader() method in this file does not determine whether "Custom Interface" is checked, resulting in the request header not having the Authorization variable, which ultimately leads to an access code error.
The solution is to go to the settings, check "Custom Interface", select the service where the access code appears, such as Azure, delete all the api key and other content, and then uncheck "Custom Interface", so that you can avoid using it. The access code of the default model is wrong.

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

No branches or pull requests

4 participants