安装PaddlePaddle:
PaddlePaddle的安装请参考文档官方安装文档,
安装PaddleNLP
# pip 一键安装
pip install --upgrade paddlenlp -i https://pypi.tuna.tsinghua.edu.cn/simple
# 或者源码进行安装最新版本
cd ${HOME}/PaddleNLP/
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
python setup.py
# pip 一键安装
pip install --upgrade paddle-pipelines -i https://pypi.tuna.tsinghua.edu.cn/simple
# 或者源码进行安装最新版本
cd ${HOME}/PaddleNLP/pipelines/
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
python setup.py
config/elasticsearch.yml
的配置:
xpack.security.enabled: false
然后启动:
./bin/elasticsearch
curl http://localhost:9200/_aliases?pretty=true
备注: ES 服务默认开启端口为 9200
python chat_documents.py
INFO - pipelines.nodes.llm.chatglm - 背景:知识库文件放在此文件目录中 问题:你好
user: 你好
assistant: ['你好!请问有什么需要帮助的吗?\n\n如果你需要查询知识库文件的内容,可以使用搜索引擎或者文件管理器等工具来查找它们。例如,在搜索引擎中输入“知识库文件 目录”或“知识库文件在此目录中的内容”,就可以找到相关的搜索结果。\n\n如果你需要对知识库文件进行修改或者添加内容,建议先备份好原始文件,然后根据具体的操作需求进行修改。一些常见的知识库文件格式包括CSV、JSON和XML等,你可以选择合适的格式来存储和管理知识库数据。']
[('你好', '你好!请问有什么需要帮助的吗?\n\n如果你需要查询知识库文件的内容,可以使用搜索引擎或者文件管理器等工具来查找它们。例如,在搜索引擎中输入“知识库文件 目录”或“知识库文件在此目录中的内容”,就可以找到相关的搜索结果。\n\n如果你需要对知识库文件进行修改或者添加内容,建议先备份好原始文件,然后根据具体的操作需求进行修改。一些常见的知识库文件格式包括CSV、JSON和XML等,你可以选择合适的格式来存储和管理知识库数据。')]
python app.py
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》