Qwen3-Omni-30B-A3B-Instruct 模型部署指南Qwen3-Omni 是一个原生端到端多语言全模态基础模型。它处理文本、图像、音频和视频,并以文本和自然语音形式提供实时流式响应。我们引入了多项架构升级,以提高性能和效率。主要特点:

Qwen3-Omni-30B-A3B-Instruct 是阿里通义千问团队在 2025 年 9 月 22 日发布的“全模态”MoE 大模型,核心定位是“能看、能听、能说”的端到端多模态助手。其模型介绍可概括为以下五点:
基础环境最低配置推荐
| 环境名称 | 版本信息 |
|---|---|
| Ubuntu | 22.04.4 LTS |
| Python | 3.10.16 |
| CUDA | 11.8 |
| NVIDIA Corporation | RTX 4090 * 4 |
查看系统版本信息
#查看系统的版本信息,包括 ID(如 ubuntu、centos 等)、版本号、名称、版本号 ID 等
cat /etc/os-release

更新软件包列表
#更新软件列表
apt-get update

配置国内镜像源(阿里云)
具体而言,vim 指令编辑文件 sources.list
#编辑源列表文件
vim /etc/apt/sources.list

按 “i” 进入编辑模式,将如下内容插入至 sources.list 文件中
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
最后,按 "esc" 键退出编辑模式,输入 :wq 命令并按下 “enter” 键便可保存并退出 sources.list 文件

创建虚拟环境
#创建名为Qwen-Image的虚拟环境,python版本:3.10
conda create -n Qwen3_Omni python=3.10
激活虚拟环境
conda activate Qwen3_Omni


github(QwenLM/Qwen3-Omni:Qwen3-omni 是由阿里云 Qwen 团队开发的原生端到端、全模态 LLM,能够理解文本、音频、图像和视频,以及实时生成语音。)中克隆项目代码文件至该目录
git clone https://github.com/QwenLM/Qwen3-Omni.git

安装Transformers框架及accelerate库
pip install git+https://github.com/huggingface/transformers
pip install accelerate

安装官方提供的工具包
pip install qwen-omni-utils -U

安装flash-attn以减少 GPU 内存使用(但是,如果您主要使用 vLLM 进行推理,则不需要进行此安装)
pip install -U flash-attn --no-build-isolation

安装本地 Web UI 演示的依赖库
pip install gradio==5.44.1 gradio_client==1.12.1 soundfile==0.13.1

转到魔塔社区官网下载模型文件:通义千问 3-Omni-30B-A3B-Instruct · 模型库

使用命令行下载完整模型库
#在下载前,请先通过如下命令安装
pip install modelscope
#命令行下载(下载至当前文件夹)
modelscope download --model 'Qwen/Qwen3-Omni-30B-A3B-Instruct' --local_dir './'
安装所需的软件包后,您可以使用以下命令启动 Web 演示。这些命令将启动 Web 服务器,并为您提供在 Web 浏览器中访问 UI 的链接。您可以运行并了解更多选项。python web_demo.py --help``python web_demo_captioner.py --help
# For Qwen3-Omni-30B-A3B-Instruct with vLLM backend
python web_demo.py -c Qwen/Qwen3-Omni-30B-A3B-Instruct
# For Qwen3-Omni-30B-A3B-Instruct with Transformers backend
python web_demo.py -c Qwen/Qwen3-Omni-30B-A3B-Instruct --use-transformers --generate-audio
# For Qwen3-Omni-30B-A3B-Instruct with Transformers backend and FlashAttention support
python web_demo.py -c Qwen/Qwen3-Omni-30B-A3B-Instruct --use-transformers --generate-audio --flash-attn2
# For Qwen3-Omni-30B-A3B-Thinking with vLLM backend
python web_demo.py -c Qwen/Qwen3-Omni-30B-A3B-Thinking
# For Qwen3-Omni-30B-A3B-Thinking with Transformers backend
python web_demo.py -c Qwen/Qwen3-Omni-30B-A3B-Thinking --use-transformers
# For Qwen3-Omni-30B-A3B-Thinking with Transformers backend and FlashAttention support
python web_demo.py -c Qwen/Qwen3-Omni-30B-A3B-Thinking --use-transformers --flash-attn2
# For Qwen3-Omni-30B-A3B-Captioner with vLLM backend
python web_demo_captioner.py -c Qwen/Qwen3-Omni-30B-A3B-Captioner
# For Qwen3-Omni-30B-A3B-Captioner with Transformers backend
python web_demo_captioner.py -c Qwen/Qwen3-Omni-30B-A3B-Captioner --use-transformers
# For Qwen3-Omni-30B-A3B-Captioner with Transformers backend and FlashAttention support
python web_demo_captioner.py -c Qwen/Qwen3-Omni-30B-A3B-Captioner --use-transformers --flash-attn2
运行命令后,你会在终端中看到一个类似于以下内容的链接:
Running on local: http://127.0.0.1:8901/
如果您在本地运行,请复制此链接并将其粘贴到浏览器中以访问 Web UI。如果您在服务器或容器中运行,请根据服务器的实际 IP 配置地址,或在必要时设置端口转发。

