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。