recipes/applications/chatbot/qwen_chatbot.ipynb
This notebook uses Qwen-7B-Chat as an example to introduce you to how to build a web-based conversational assistant using Gradio.
Download Qwen-7B-Chat
Firstly, we need to download the model. You can use the snapshot_download that comes with modelscope to download the model to a specified directory.
!pip install modelscope
from modelscope.hub.snapshot_download import snapshot_download
snapshot_download("qwen/Qwen-7B-Chat",cache_dir='/tmp/models')
!pip install -r ../../../requirements.txt
!pip install gradio==3.37.0 mdtex2html
Users can run the web_demo.py file to have real-time conversations with Qwen-7b-chat on the webpage.
!python ../../../web_demo.py -c /tmp/models/qwen/Qwen-7B-Chat