ChuanhuChatGPT icon indicating copy to clipboard operation
ChuanhuChatGPT copied to clipboard

[Bug]: azure 模型下知识库问答报错

Open stockcoder opened this issue 1 year ago • 6 comments

这个bug是否已存在现有issue了?

  • [X] 我确认没有已有issue,且已阅读常见问题

错误表现

2023-10-08 15:38:18,860 [INFO] [index_func.py:125] 构建索引中…… 2023-10-08 15:38:26,338 [WARNING] [before_sleep.py:65] Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')). 2023-10-08 15:38:30,670 [WARNING] [before_sleep.py:65] Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')). 2023-10-08 15:38:34,986 [WARNING] [before_sleep.py:65] Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')). 2023-10-08 15:38:39,309 [WARNING] [before_sleep.py:65] Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 8.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')). 2023-10-08 15:38:47,653 [WARNING] [before_sleep.py:65] Retrying langchain.embeddings.openai.embed_with_retry.._embed_with_retry in 10.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')). 2023-10-08 15:38:57,992 [ERROR] [index_func.py:136] 索引构建失败!Error communicating with OpenAI: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

复现操作

不提供其它 key,只配置azure 的,也正确提供了azure_embedding_deployment_name,聊天可以正常使用,但是上传文档知识库似乎链接的还是 openai 的

错误日志

No response

运行环境

  • OS:
  • Browser:
  • Gradio version:
  • Python version:

帮助解决

  • [ ] 我愿意协助解决!

补充说明

No response

stockcoder avatar Oct 08 '23 10:10 stockcoder

你可以把配置信息发到我的邮箱,我解决一下:[email protected]

GaiZhenbiao avatar Oct 10 '23 05:10 GaiZhenbiao

遇到相同的问题。配置我仔细检查了没有问题 索引构建失败!Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

TigrisRiva avatar Dec 13 '23 06:12 TigrisRiva

完整信息: 加载索引中…… /usr/local/lib/python3.9/site-packages/langchain/embeddings/openai.py:320: UserWarning: If you have openai>=1.0.0 installed and are using Azure, please use the AzureOpenAIEmbeddings class. warnings.warn( 2023-12-13 01:31:08,698 [INFO] [index_func.py:25] loading file: 简易待办.txt 2023-12-13 01:31:08,700 [INFO] [index_func.py:126] 构建索引中…… 2023-12-13 01:31:09,017 [ERROR] [index_func.py:137] 索引构建失败!Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

TigrisRiva avatar Dec 13 '23 06:12 TigrisRiva

我调查一下🤔你可以暂时使用本地编制索引的功能,其实效果不比OpenAI的差。

GaiZhenbiao avatar Dec 18 '23 06:12 GaiZhenbiao

这个其实不能算一个BUG,只不过大家搭建环境的时候OPENAI版本号不一样 导致整个代码可能都不同。

TigrisRiva avatar Dec 18 '23 07:12 TigrisRiva

我也遇到了同样的情况,对话是正常的,但是知识库会报这个错

shydyl avatar Jan 14 '24 07:01 shydyl

完整信息: 加载索引中…… /usr/local/lib/python3.9/site-packages/langchain/embeddings/openai.py:320: UserWarning: If you have openai>=1.0.0 installed and are using Azure, please use the AzureOpenAIEmbeddings class. warnings.warn( 2023-12-13 01:31:08,698 [INFO] [index_func.py:25] loading file: 简易待办.txt 2023-12-13 01:31:08,700 [INFO] [index_func.py:126] 构建索引中…… 2023-12-13 01:31:09,017 [ERROR] [index_func.py:137] 索引构建失败!Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

已经按提示修改 #1158

同时我还发现当我的配置文件中azure_openai_api_base_url=https://xxxxxxx.openai.azure.com/openai 就提示 ”Resource not found“,改成https://xxxxxxx.openai.azure.com/ ,local_embedding 也 改成false 就可以了

ZhengQinyu avatar Sep 05 '24 05:09 ZhengQinyu