ChuanhuChatGPT
ChuanhuChatGPT copied to clipboard
[Bug]: azure 模型下知识库问答报错
这个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.
复现操作
不提供其它 key,只配置azure 的,也正确提供了azure_embedding_deployment_name,聊天可以正常使用,但是上传文档知识库似乎链接的还是 openai 的
错误日志
No response
运行环境
- OS:
- Browser:
- Gradio version:
- Python version:
帮助解决
- [ ] 我愿意协助解决!
补充说明
No response
你可以把配置信息发到我的邮箱,我解决一下:[email protected]
遇到相同的问题。配置我仔细检查了没有问题 索引构建失败!Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}
完整信息:
加载索引中……
/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'}}
我调查一下🤔你可以暂时使用本地编制索引的功能,其实效果不比OpenAI的差。
这个其实不能算一个BUG,只不过大家搭建环境的时候OPENAI版本号不一样 导致整个代码可能都不同。
我也遇到了同样的情况,对话是正常的,但是知识库会报这个错
完整信息: 加载索引中…… /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 就可以了