stulzq / azure-openai-proxy

Azure OpenAI Service Proxy. Convert OpenAI official API request to Azure OpenAI API request. Support GPT-4,Embeddings,Langchain. Adapter from OpenAI to Azure OpenAI.
Apache License 2.0
1.3k stars 190 forks source link

无法使用GPT-4 #23

Closed jebouruama closed 1 year ago

jebouruama commented 1 year ago

我尝试使用azure openai gpt-4部署模式时,报错。

docker-compose.yml 配置为: AZURE_OPENAI_MODEL_MAPPER: gpt-4=gpt4

启动后mapper中有两个键值对(第一个是默认值,第二个是yml中设定的值):如下图 CleanShot 2023-04-20 at 20 31 45@2x

开始对话报错如下: undefined [ChatGPT error 404: {"error":{"code":"DeploymentNotFound", "message":"The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again."}}]

多次尝试发现AZURE_OPENAI_MODEL_MAPPER如果设置为非”gpt-3.5-turbo“键,则最终mapper中会添加一个键值对,而不是替换默认第一个键值对,而程序默认使用第一个键值对的值,该值在我的azure资源中没有相应的资源名称,因此报错资源不存在。 如果将model mapper设置为:AZURE_OPENAI_MODEL_MAPPER: gpt-3.5-turbo=gpt4,则仅有一个键值对,可以正常对话,但看程序输出使用的还是gpt-3.5模型,而不是gpt-4

stulzq commented 1 year ago

你看一下chatgpt-web的文档,这个也是需要设置的,默认它传3.5,你如果需要使用gpt-4,它是必须设置的哈,gpt4我自己已经用了半个月了。

stulzq commented 1 year ago

15

jebouruama commented 1 year ago

多谢指点,终于搞明白了。提个小建议,在说明文档的docker-compose.yml中添加OPENAI_API_MODEL环境变量的设置就更清晰了。

stulzq commented 1 year ago

好的 我更新到 README

drxmy commented 1 year ago

您好,想问一下azure的gpt4容易申请吗?

jebouruama commented 1 year ago

您好,想问一下azure的gpt4容易申请吗?

我们同时是azure中国和azure global的企业用户,申请时请微软的人内部打了招呼(也不知道是否管用),等了大约2周通过的。普通个人用户不太清楚是不是获批时间会比较长。