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] 单独自定义azure模型的情况下无法生效 #5016

Open
aiyurui opened this issue Jul 15, 2024 · 34 comments
Open

[Bug] 单独自定义azure模型的情况下无法生效 #5016

aiyurui opened this issue Jul 15, 2024 · 34 comments
Assignees
Labels
documentation Improvements or additions to documentation invalid This doesn't seem right

Comments

@aiyurui
Copy link

aiyurui commented Jul 15, 2024

📦 Deployment Method

Docker

📌 Version

v2.13

💻 Operating System

Other Linux

📌 System Version

debian 11

🌐 Browser

Chrome

📌 Browser Version

126

🐛 Bug Description

最新版本docker compose部署,只配置了azure相关,openai相关全部注释

如果在默认模型中直接选择gpt-4o(azure),会走AZURE_URL且正常返回消息

但是如果yml中定义模型:- CUSTOM_MODELS=-all,+gpt-4o@azure

默认走会openai解析,导致返回失败

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

@aiyurui aiyurui added the bug Something isn't working label Jul 15, 2024
@Issues-translate-bot
Copy link

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


Title: [Bug] It cannot take effect when the azure model is customized separately

@lloydzhou lloydzhou self-assigned this Jul 15, 2024
@Sha1rholder
Copy link

我遇到了相同的问题,在仅配置azure服务时完全无法使用

image

无论是配置自定义endpoint还是写access code都无效,希望大佬早日修复。Azure openai matters, thanks!

@Issues-translate-bot
Copy link

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


I had the same issue and it didn't work at all when only configuring the azure service

image

No matter configuring a custom endpoint or writing access code, it is invalid. I hope you can fix it as soon as possible. Azure openai matters, thanks!

@miaoxiaohei666
Copy link

me too

@Issues-translate-bot
Copy link

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


Now the entire nextchat azure is completely unavailable

@lloydzhou
Copy link
Member

lloydzhou commented Jul 16, 2024

看了看几个相关的issue,都提到azure使用上的问题。

但是,我不管是使用环境变量配置,还是配置自定义接口,都正常使用。

所以,希望出现问题的朋友,能提供一些更加详细的配置(移除key等敏感信息)以及报错信息,以方便排查吗?

例如报错的时候,提供一下网络面板的截图,以及控制台的截图之类的。
image

如果大家只说一句“不可用”,又没有其他信息以便复现问题,那么,就找不到问题所在,修复也就无从谈起,对吧?

@Issues-translate-bot
Copy link

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


After looking at several related issues, they all mentioned problems with using Azure.

However, whether I use environment variable configuration or configure a custom interface, it works normally.

Therefore, I hope that friends who have problems can provide some more detailed configurations (removing sensitive information such as keys) and error messages to facilitate troubleshooting?

@Sha1rholder
Copy link

看了看几个相关的issue,都提到azure使用上的问题。

但是,我不管是使用环境变量配置,还是配置自定义接口,都正常使用。

所以,希望出现问题的朋友,能提供一些更加详细的配置(移除key等敏感信息)以及报错信息,以方便排查吗?

这里是我所有配置信息:

image
image
image

密码是临时写的不用担心泄露

@Issues-translate-bot

This comment was marked as duplicate.

@lloydzhou
Copy link
Member

lloydzhou commented Jul 16, 2024

@Sha1rholder
image
我应该找到问题了:

  1. gpt4o不是内置的模型名称,应该是 gpt-4o(你第二张截图显示的模型名称也应该是gpt-4o)所以你的配置应该写gpt-4o@azure=gpt4o
  2. 这里配置的模型名称错了,所以找不到模型列表,展示的模型选项是gpt4o(azure),如果正常匹配到模型名称,应该是gpt4o(Azure)其中Azure是大写。
  3. 如果想要添加不在内置模型列表中的模型,这个时候,配置CUSTOM_MODELS的时候@后面可以使用大写的供应商类型gpt-4o@Azure=gpt4o

@Issues-translate-bot
Copy link

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


@Sha1rholder
image
I should have found the problem:

  1. gpt4o is not a built-in model name, it should be gpt-4o (the model name shown in your second screenshot should also be gpt-4o)
  2. The model name configured here is wrong, so the model list cannot be found. The model option displayed is gpt4o(azure). If the model name is matched normally, it should be gpt4o(Azure), where Azure is capitalized .
  3. If you want to add a model that is not in the built-in model list, at this time, when configuring CUSTOM_MODELS, you can use the uppercase supplier type gpt-4o@Azure=gpt4o after @

@aiyurui
Copy link
Author

aiyurui commented Jul 16, 2024

看了看几个相关的issue,都提到azure使用上的问题。

但是,我不管是使用环境变量配置,还是配置自定义接口,都正常使用。

所以,希望出现问题的朋友,能提供一些更加详细的配置(移除key等敏感信息)以及报错信息,以方便排查吗?

例如报错的时候,提供一下网络面板的截图,以及控制台的截图之类的。 image

如果大家只说一句“不可用”,又没有其他信息以便复现问题,那么,就找不到问题所在,修复也就无从谈起,对吧?

老师您好,我刚想把配置发出来,但是我重新测试了一下发现又没有问题了,昨天我无论如何测试,都会出现这个问题。抱歉:)

@Issues-translate-bot
Copy link

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


After looking at several related issues, they all mentioned problems with using Azure.

However, whether I use environment variable configuration or configure a custom interface, it works normally.

So, I hope that friends who have problems can provide some more detailed configurations (removing sensitive information such as keys) and error messages to facilitate troubleshooting?

For example, when reporting an error, provide screenshots of the network panel and console. ! [Image] (https://private- user-images.githubusercontent.com/1826685/34896118-284c63d6-3aca-94e4-5871c9bf5a03.jwt=eyjhbg CIOJIUZI1NIISINR5CCI6IKPXVCJ9.EYJPC3MIOJNAXRODWIUY29TIIWIYXVKI je3mjexmTi3nti3ntiM5izii6MTCYMTEXMJQ1NIWICGF0ACI6II8XODI2NJG1LZM 0odk2njexoc0zywnhltotrncxyzlizjvhmDMUC G5NP1GTQW16LUFSZ29YAXROBT1BV1M0LUHNQUMTU0HBMJLGTQW16lunyzwr LBNRPYWW9QUTJQVZDTFNKELMDCXNVZLWVHC3 Qtmsuyrnmzjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtznf9yzxf1zxn0JLGTQW16Lurhdgu9mjaynda3MTZMTZM2wizyluftei1fehbpczyluftei1CMDQXZJZM MJGWMTEZNJY4ZZZYWEWODK5YJEWNTVLZTG1MJJHMWMMJQ5555555MTKXZGIZNTE2OTK3NIZYLUZWRIZWFKZPHVC3QMYWN0B3JFAWQ 9mczrzxLFAWQ9MCZYZXBVX2LKPTAIFQ.87jbt075a0JD7NCYWGJICBGIG6KA_D_ZZAUJ0UMISC0))))))

If everyone just says "not available" and there is no other information to reproduce the problem, then the problem cannot be found and there is no way to fix it, right?

Hello teacher, I just wanted to send out the configuration, but I retested it and found that there was no problem again. No matter how I tested yesterday, this problem would appear. Feel sorry:)

@lloydzhou
Copy link
Member

关于如何配置使用Azure的资源,大家可以仔细的看一下READMECUSTOM_MODELS部分关于Azure的说明:其实主要就是使用以前的display_name当作deploy_name使用。

也可以看这个issue中的说明 #5001 (里面列举了几种情况应该怎么配置。这个issue现在是置顶状态,应该挺好找的)

@aiyurui
Copy link
Author

aiyurui commented Jul 16, 2024

关于如何配置使用Azure的资源,大家可以仔细的看一下READMECUSTOM_MODELS部分关于Azure的说明:其实主要就是使用以前的display_name当作deploy_name使用。

也可以看这个issue中的说明 #5001 (里面列举了几种情况应该怎么配置。这个issue现在是置顶状态,应该挺好找的)

确定昨天按照置顶issue配置的,仔细核实复现了多次才提交了bug issue,但今天却无论如何都复现不了了,不知道是什么问题。。(我确定不是上面那位朋友模型名写错的原因)

@Issues-translate-bot
Copy link

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


Regarding how to configure resources using Azure, you can take a closer look at CUSTOM_MODELS in [README](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web?tab=readme-ov-file#custom_models-optional) Part of the explanation about Azure: In fact, the main thing is to use the previous display_name as deploy_name.

You can also read the instructions in this issue #5001 (it lists how to configure it in several situations. This issue is now pinned, so it should be easy to find)

I made sure that I configured it according to the issued issue yesterday. I carefully verified that it recurred many times before submitting a bug issue. But today, it can't reoccur anyway. I don't know what the problem is. . (I’m sure it’s not because the friend above wrote the wrong model name)

@lloydzhou lloydzhou added documentation Improvements or additions to documentation invalid This doesn't seem right and removed bug Something isn't working labels Jul 16, 2024
@yidasanqian
Copy link

碰到同样问题,之前好好的,这几天都用不了
image

AZURE_URL=https://xx.openai.azure.com/openai/deployments/gpt-4o
image

@Issues-translate-bot
Copy link

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


I encountered the same problem. It worked fine before, but now it doesn’t work for the past few days.
image

AZURE_URL=https://xx.openai.azure.com/openai/deployments/gpt-4o
image

@Sha1rholder
Copy link

大佬,经过我多次修改环境变量和自定义配置后终于知道是哪里的问题了!也知道为什么您实验不出来这个问题了,您可能是直接在网页中的 Custom Endpoint 中修改,而有些用户直接在环境变量中修改。现在解决Azure不可用的问题需要修改两个东西,一个是 环境变量中只配置azure openai相关配置时,修改关于访问码 CODE 的bug,一个是 修改使用azure openai的文档,应该是 https://xxxx.azure.com/openai 而不是 https://xxxx.azure.com/openai/deployments,这两个修好后应该就可以把最近Azure的问题Close掉了。关于代码中需要改的,具体可以看下面两个示例:

  1. 只填写azure相关环境变量时,访问码不可用
    image
    网页配置
    image
    环境变量设置
    image
    image
    报错,但是图中可以看到我实际上都填好了access code

  2. Custom Endpoint后,跳过access code环节,就完全可用了
    image
    image
    如图

Azure文档还不是很清晰,如果大佬觉得ok的话我待会交个pr修改一下文档把azure使用方面讲详细点

@Issues-translate-bot
Copy link

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


Boss, after I modified the environment variables and customized configuration many times, I finally figured out what the problem was! I also know why you can't find this problem in your experiment. You may modify it directly in the Custom Endpoint on the web page, while some users modify it directly in the environment variables. Now to solve the problem of Azure unavailability, two things need to be modified. One is to modify the bug about the access code CODE when only azure openai related configuration is configured in the environment variable, and the other is to modify the documentation for using azure openai. , it should be https://xxxx.azure.com/openai instead of https://xxxx.azure.com/openai/deployments**. After these two are repaired, you should be able to close the recent Azure issues. Lost. Regarding what needs to be changed in the code, you can see the following two examples:

  1. When only filling in Azure-related environment variables, the access code is not available.
    image
    Web page configuration
    image
    Environment variable settings
    image
    image
    An error is reported, but you can see in the picture that I actually filled in the access code.

  2. After Custom Endpoint, skip the access code link and it will be fully usable.
    image
    image
    As shown in the picture

The Azure documentation is not very clear yet. If you think it is ok, I will submit a PR later to modify the documentation and explain the use of Azure in more detail.

@ElricLiu
Copy link
Contributor

@Sha1rholder 非常欢迎提交pr

@Issues-translate-bot
Copy link

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


@Sha1rholder is very welcome to submit PR

@Sha1rholder
Copy link

@Sha1rholder 非常欢迎提交pr

已经提交pr#5049了,这个pr只对原本就有的中英文文档进行了一些小幅的修改,希望麻烦主要贡献者审核通过。不过在仔细阅读README的时候我觉得写得实在不是很清晰,不是这点改动就能改好的。现在一方面需要作者大大修改仅使用Azure OpenAI时的empty access code的bug,一方面我想写个azure openai的教程,和vercel教程放同个地方,一方面我觉得README确实需要重构一下

@Issues-translate-bot
Copy link

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


@Sha1rholder is very welcome to submit PR

pr#5049 has been submitted. This PR only made some minor modifications to the original Chinese and English documents. I hope it will be troublesome. Approved by major contributors. However, when I read the README carefully, I feel that the writing is not very clear, and it cannot be improved by this change. Now on the one hand, the author needs to greatly modify the bug of empty access code when only using Azure OpenAI. On the other hand, I want to write an azure openai tutorial, and [vercel tutorial](https://github.com/ChatGPTNextWeb/ChatGPT- Next-Web/blob/main/docs/vercel-cn.md) in the same place. On the one hand, I think the README really needs to be restructured.

@ElricLiu
Copy link
Contributor

@Sha1rholder 非常欢迎提交pr

已经提交pr#5049了,这个pr只对原本就有的中英文文档进行了一些小幅的修改,希望麻烦主要贡献者审核通过。不过在仔细阅读README的时候我觉得写得实在不是很清晰,不是这点改动就能改好的。现在一方面需要作者大大修改仅使用Azure OpenAI时的empty access code的bug,一方面我想写个azure openai的教程,和vercel教程放同个地方,一方面我觉得README确实需要重构一下

非常感谢,我们会在稍后bug 修复完毕后,来进行处理合并

@Issues-translate-bot
Copy link

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


@Sha1rholder is very welcome to submit PR

pr#5049 has been submitted. This PR only made some minor modifications to the original Chinese and English documents. I hope Please trouble the main contributors to approve it. However, when I read the README carefully, I feel that the writing is not very clear, and it cannot be improved by this change. Now on the one hand, the author needs to greatly modify the bug of empty access code when only using Azure OpenAI. On the other hand, I want to write an azure openai tutorial, and [vercel tutorial](https://github.com/ChatGPTNextWeb/ChatGPT- Next-Web/blob/main/docs/vercel-cn.md) in the same place. On the one hand, I think the README really needs to be restructured.

Thank you very much. We will merge it later after the bug is fixed.

@Andy-qinyuhai
Copy link

请问一下 仅使用Azure OpenAI时的empty access code的bug 目前有修复了吗?我用最新的版本还是存在这个问题

@Issues-translate-bot
Copy link

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


I would like to ask if the bug of empty access code when only using Azure OpenAI has been fixed? I'm using the latest version and still have this problem

@jameel-shorosh-silk
Copy link

Hello, the bug of "empty access code" is still happening to me, I am not able to use it with azure (unless I configure the CODE in the GUI which is not a solution for many users in an organization). any estimation when this problem will be solved ?

@jameel-shorosh-silk
Copy link

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

I would like to ask if the bug of empty access code when only using Azure OpenAI has been fixed? I'm using the latest version and still have this problem

this bug is happening to me as well.

@CharlinChen
Copy link

v2.15.3依然遇到empty access code问题,在配置页自定义Azure接口没有问题,但是通过环境变量配置就会报empty access code。
网页控制台查看post请求为401错误,以下为浏览器控制台日志:

[User Input] after template: hello
[Request] openai payload: Objectxxx
[Proxy Endpoint]  /api/azure deployments/Test-chatGPT/chat/completions?api-version=
post http://xxxx:xxxx/api/azure/deployments/Test-chatGPT/chat/completions?api-version=
状态:401 Unauthorized

我启动docker镜像的环境变量配置如下:

...
-e AZURE_URL='https://xxxx.azure.com/openai' \
-e AZURE_API_KEY='xxxx' \
-e AZURE_API_VERSION='2023-07-01-preview' \
-e CUSTOM_MODELS='+AzureGPT-3.5@Azure=Test-chatGPT'
...

@Issues-translate-bot
Copy link

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


v2.15.3 still encounters the problem of empty access code. There is no problem in customizing the Azure interface on the configuration page, but empty access code will be reported through environment variable configuration.
The web console shows a 401 error in the post request. The following is the browser console log:

[User Input] after template: hello
[Request] openai payload: Objectxxx
[Proxy Endpoint] /api/azure deployments/Test-chatGPT/chat/completions?api-version=
post http://xxxx:xxxx/api/azure/deployments/Test-chatGPT/chat/completions?api-version=
Status: 401 Unauthorized

My environment variable configuration for starting the docker image is as follows:

...
-e AZURE_URL='https://xxxx.azure.com/openai' \
-e AZURE_API_KEY='xxxx' \
-e AZURE_API_VERSION='2023-07-01-preview' \
-e CUSTOM_MODELS='+AzureGPT-3.5@Azure=Test-chatGPT'
...

@jameel-shorosh-silk
Copy link

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

v2.15.3 still encounters the problem of empty access code. There is no problem in customizing the Azure interface on the configuration page, but empty access code will be reported through environment variable configuration. The web console shows a 401 error in the post request. The following is the browser console log:

[User Input] after template: hello
[Request] openai payload: Objectxxx
[Proxy Endpoint] /api/azure deployments/Test-chatGPT/chat/completions?api-version=
post http://xxxx:xxxx/api/azure/deployments/Test-chatGPT/chat/completions?api-version=
Status: 401 Unauthorized

My environment variable configuration for starting the docker image is as follows:

...
-e AZURE_URL='https://xxxx.azure.com/openai' \
-e AZURE_API_KEY='xxxx' \
-e AZURE_API_VERSION='2023-07-01-preview' \
-e CUSTOM_MODELS='+AzureGPT-3.5@Azure=Test-chatGPT'
...

I cannot configure the configuration page, I am using it in my orginization and the access code should not be visible to the developers. any estimation when the fix will be fixed?

@jameel-shorosh-silk
Copy link

Hi,
any update regrading this bug? we are not able to use azure openAI in the new versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

10 participants