工作日记:在win11上开启WSL安装ubuntu,使用VLLM运行ASR模型

Qwen-ASR -0.6安装教程

一、开启WSL安装ubuntu

安装ubuntu

win11支持开启wsl运行linux系统

win+R打开cmd

输入

bash 复制代码
wsl --install

默认下载最新版ubuntu

指定版本用下面的命令

bash 复制代码
wsl --install -d Ubuntu-22.04

安装的ubuntu默认在c盘,若是要改下安装位置可以通过以下方式
1.导出镜像到D盘

bash 复制代码
wsl --export Ubuntu-22.04 D:\WSL\Ubuntu2204_wsl.tar

2.注销旧版

bash 复制代码
wsl --unregister Ubuntu-22.04

3.导入新镜像到指定位置

bash 复制代码
wsl --import Ubuntu-22.04 D:\WSL\Ubuntu2204 D:\WSL\Ubuntu2204_wsl.tar --version 2

4.验证迁移

bash 复制代码
wsl -l -v

替换国内源

备份原有的源列表文件:

bash 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

对/etc/apt/sources.list内容进行替换

bash 复制代码
# 阿里云镜像
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
bash 复制代码
# 清华大学镜像
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
bash 复制代码
# 华为云镜像
deb https://repo.huaweicloud.com/ubuntu/ focal main restricted universe multiverse
deb https://repo.huaweicloud.com/ubuntu/ focal-security main restricted universe multiverse
deb https://repo.huaweicloud.com/ubuntu/ focal-updates main restricted universe multiverse
deb https://repo.huaweicloud.com/ubuntu/ focal-proposed main restricted universe multiverse
deb https://repo.huaweicloud.com/ubuntu/ focal-backports main restricted universe multiverse

二、安装minconda

minconda用于管理python环境,较为方便,建议安装,不安装使用pip也可。
1、下载执行脚本

bash 复制代码
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

2、添加可执行权限

bash 复制代码
sudo chmod +x Miniconda3-latest-Linux-x86_64.sh

3、运行安装脚本

bash 复制代码
sudo ./Miniconda3-latest-Linux-x86_64.sh

第一步:按 Enter 查看许可协议,按 空格 翻页至末尾,输入 yes 接受协议。

第二步:选择安装路径(默认 ~/miniconda3,直接按 Enter 确认即可;若需自定义,输入路径后回车,确保路径所在磁盘有足够空间)。

第三步:询问 "是否初始化 Miniconda(conda init)",建议输入 yes(自动配置环境变量,避免后续手动配置的麻烦)。

生效环境变量

bash 复制代码
source ~/.bashrc

验证安装结果

bash 复制代码
conda --version

添加清华镜像

bash 复制代码
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

三、下载模型并安装python依赖

安装modelscope

bash 复制代码
pip install -U modelscope

下载模型文件到指定位置

bash 复制代码
modelscope download --model Qwen/Qwen3-ASR-0.6B --local_dir ./Qwen3-ASR-0.6B

创建一个干净的 Python 3.12 环境

bash 复制代码
conda create -n qwen3-asr python=3.12 -y
conda activate qwen3-asr

下载qwen-asrvllm

bash 复制代码
pip install -U qwen-asr[vllm]

四、启动模型

bash 复制代码
qwen-asr-serve Qwen/Qwen3-ASR-0.6B --gpu-memory-utilization 0.8 --host 0.0.0.0 --port 8000

作者测试时报错没有c++编辑器,执行以下安装

bash 复制代码
# 更新软件源
apt update

# 安装 gcc(C编译器)、make、build-essential(编译必备套件)
apt install -y gcc make build-essential

# 验证 gcc 是否安装成功
gcc --version

注2

作者电脑配置较低,4060显存不够,更改一些参数,其中模型地址使用绝对路径,max-model-len改小一点

bash 复制代码
qwen-asr-serve /root/Qwen/Qwen3-ASR-0.6B --gpu-memory-utilization 0.8 --max-model-len 32224 --host 0.0.0.0 --port 8000 --trust-remote-code
相关推荐
Rain5094 分钟前
2.3. 安全配置:环境变量与 API 密钥管理
前端·人工智能·后端·安全·ai·node.js·ai编程
狮子再回头8 分钟前
relhat9.1 yum无法安装问题
linux·运维·centos
暮云星影9 分钟前
全志linux开发 USB接口设置
linux·arm开发·驱动开发
FII工业富联科技服务15 分钟前
“可持续灯塔工厂”技术解密:AI+IoT如何落地端到端碳管理闭环
大数据·人工智能·物联网·ai·数据分析·自动化·制造
Attachment George18 分钟前
山东大学软件学院-项目实训-个人开发日志(十):材料问答链路开发——文档解析、OCR兜底与持续追问完善
python·ai·langchain·kotlin·rag
Flittly18 分钟前
【AgentScope Java新手村系列】(8)多Agent协作
java·spring boot·笔记·spring·ai
花间相见21 分钟前
【大模型部署01】—— vLLM 部署大模型服务实操:从 0 到 1 搭建 OpenAI 兼容 API
vllm
小七-七牛开发者27 分钟前
周一上线|瑞幸把咖啡做进 CLI,Fable 5 短暂登场,Stonk Rider 骑上 K 线图
ai·chatgpt·大模型·agent·claude·codex·skill·claudecode·ai coding
江华森27 分钟前
Linux 系统实战完全指南
linux·运维·服务器
Safeploy安策数据29 分钟前
政务云加密太慢?万兆服务器密码机如何破解高并发性能瓶颈
linux·运维·github