This is an example project for demonstrating how to deploy the Qwen model locally. It includes the necessary code and documentation to help users quickly get started and run the Qwen model locally.
. /
├── README.md # Project description file
├── requirements.txt # List of dependencies
├── chatbot_server.py # Qwen model server code, encapsulating an interface that supports streaming processing to return generation results in real-time and provide them to the front end
├── chatbot_client.py # Qwen model client code, demonstrating how to call the server interface for dialogue, using streamlit to build a simple front-end interface
└── audio_server.py # Audio processing server code, encapsulating an interface for audio-to-text conversion to support voice input and return the converted text to the front end
conda env create -f environment.ymlconda activate qwen-env
pip install -r requirements.txt- Start the audio processing server (optional, if voice input is needed):
uvicorn audio_server:app --host 0.0.0.0 --port 5001 --reload- Start the Qwen model server:
uvicorn chatbot_server:app --host 0.0.0.0 --port 5000 --reload- Start the front-end interface:
streamlit run chatbot_clientv2.py- Open your browser and go to
http://localhost:8501to use the chat interface.
The Qwen-4b model must use GPU deployment. Please ensure that your local machine has a compatible GPU and the necessary CUDA drivers installed.
- Python 3.8+
- Streamlit
- FastAPI
- Uvicorn
- Qwen Model SDK
- RTX5060Ti GPU with 16GB VRAM
This project is licensed under the MIT License. See the LICENSE file for details.