Back to Qwen

Qwen-7B-Chat Chat Demo

recipes/applications/chatbot/qwen_chatbot.ipynb

latest875 B
Original Source

Qwen-7B-Chat Chat Demo

This notebook uses Qwen-7B-Chat as an example to introduce you to how to build a web-based conversational assistant using Gradio.

Preparation

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.

python
!pip install modelscope
python
from modelscope.hub.snapshot_download import snapshot_download
snapshot_download("qwen/Qwen-7B-Chat",cache_dir='/tmp/models') 

Install Dependencies

python
!pip install -r ../../../requirements.txt
!pip install gradio==3.37.0 mdtex2html

Run the web UI code to start the Qwen chatbot

Users can run the web_demo.py file to have real-time conversations with Qwen-7b-chat on the webpage.

python
!python ../../../web_demo.py -c /tmp/models/qwen/Qwen-7B-Chat