AutClothingChatbot
1.0.0
该存储库包含用于聊天机器人的源代码,该聊天机器人是为服装店的服装顾问和网站指南。聊天机器人是使用由不舒服框架加载的微调大语言模型(LLM)构建的,以更快地推理并利用检索增强生成(RAG)方法,以从存储在许多文本文件中的知识库中检索信息。
要部署聊天机器人,请按照以下步骤:
git clone https://github.com/QuangNguyen2910/AutClothingChatbot.gitrequirements.txt中列出的所需依赖项:在此命令中,我使用Colab内核并移至Autclothingchatbot文件夹:
cd AutClothingChatbot
pip install -r requirements.txt将您要建模的任何文档上传到docs中获取数据
运行主脚本以启动聊天机器人:
如果您不知道该放在解析器运行中:
python main.py --help结果将是这样:
usage: parser.py [-h] -mn MNAME [-l4 LOAD4BIT] [-hf HFTOKEN] [-ng NGROKTOKEN] [-ms MAXSEQ] [-dt DTYPE] [-emn EMNAME] [-d DISPLAY]
Config for using LLMs.
optional arguments:
-h, --help show this help message and exit
-mn MNAME, --mname MNAME
The path or name from hugging face of the model, example: "Quangnguyen711/clothes_shop_chatbot_QLoRA".
-l4 LOAD4BIT, --load4bit LOAD4BIT
Whether to load in the model 4-bit or not, example: "True"/"False".
-hf HFTOKEN, --hftoken HFTOKEN
Hugging face token to use for authentication, example: "hf_xxx".
-ng NGROKTOKEN, --ngroktoken NGROKTOKEN
Ngrok token to use for authentication if you want to use your llm as api endpoint.
-ms MAXSEQ, --maxseq MAXSEQ
Maximum sequence length for the input, example: "2048".
-dt DTYPE, --dtype DTYPE
Data type for model weights, example: "None".
-emn EMNAME, --emname EMNAME
The path or name from hugging face of the model use to embedd data, example: "thenlper/gte-small".
-d DISPLAY, --display DISPLAY
Where to display the model, example: "kernel"/"api"/"deploy".
示例命令:
python main.py -mn " Quangnguyen711/clothes_shop_chatbot_QLoRA "
-l4 " True " -hf " hf_xxx " -ng " xxx " -ms " 2048 " -dt " None "
-emn " thenlper/gte-small " -d " deploy "注意:对于某些型号,需要从拥抱面上的身份验证令牌才能读取。
这将是您在运行此命令后获得的接口,您可以使用此笔记本查看指令
聊天机器人运行后,用户可以通过在聊天接口中键入查询或请求来与之进行交互。然后,聊天机器人将根据其知识库中存储的信息提供响应。
该项目是根据MIT许可证获得许可的 - 有关详细信息,请参见许可证文件。
有关任何查询或支持,请联系Quang Nguyen。