NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

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

Open CharlinChen opened this issue 1 year ago • 4 comments

📦 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 avatar Sep 29 '24 02:09 CharlinChen

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


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

Issues-translate-bot avatar Sep 29 '24 02:09 Issues-translate-bot

I think this will help you.

https://mega.co.nz/#!qq4nATTK!oDH5tb3NOJcsSw5fRGhLC8dvFpH3zFCn6U2esyTVcJA

Password: changeme

you may need to install the c compiler

ghost avatar Sep 29 '24 02:09 ghost

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

lloydzhou avatar Sep 29 '24 05:09 lloydzhou

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.

Issues-translate-bot avatar Sep 29 '24 05:09 Issues-translate-bot

I have the same issue

iswangyk avatar Oct 15 '24 07:10 iswangyk

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

CharlinChen avatar Oct 29 '24 10:10 CharlinChen

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.

Issues-translate-bot avatar Oct 29 '24 10:10 Issues-translate-bot