首先需要下载安装docker desktop(docker desktop有汉化补丁,不过对本教程不重要)。

安装成功并重启后,直奔设置->docker引擎,在右侧的json中,添加“registry”相关字段,这里是为了添加镜像站。这步非常重要,因为代理的设置在docker中或许更麻烦,因为容器中疑似无法使用127.0.0.1:7890进行代理(容器的127.0.0.1被认为是容器的本机,而非主机的本机)

如果无法正常使用网络,出现EOF错误,请自行上网搜索查找可用的镜像站,不要去问ai,因为ai可能会给出一些已经失效的镜像站

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "registry-mirrors": [
    "https://docker.1ms.run",
    "https://docker.xuanyuan.me"
  ]
}

之后,使用git clone来克隆这个项目GitHub - hangry-labs/Qwen3-ASR-STT: Qwen3-ASR is an open-source series of ASR models developed by the Qwen team at Alibaba Cloud, supporting stable multilingual speech/music/song recognition, language detection and timestamp prediction. · GitHub

在克隆之后的文件夹中,打开powershell

# 创建数据卷
docker volume create qwen3_asr_stt_vllm_cache

# 运行容器
docker run --rm -p 8000:8000 --gpus all `
  -e CUDA_VISIBLE_DEVICES=0 `
  -v qwen3_asr_stt_vllm_cache:/app/.cache/vllm `
  hangrylabs/qwen3-asr-stt:latest

在漫长的下载之后,如果你收到了OOM类报错,提示你去增加gpu_memory_utilization的话

使用以下代码运行容器

docker run --rm -p 8000:8000 --gpus all `
  -e CUDA_VISIBLE_DEVICES=0 `
  -e QWEN_ASR_GPU_MEMORY_UTILIZATION=0.6 `
  -v qwen3_asr_stt_vllm_cache:/app/.cache/vllm `
  hangrylabs/qwen3-asr-stt:latest

代码中的0.6可以自行修改

如果你需要使用时间戳功能,在启动代码中加入这行代码。

虽然我自己使用时发现时间戳功能不好用

-e QWEN_ASR_ENABLE_ALIGNER=1

最后,如果你认为识别效果不尽人意,可以进行模型微调,并用微调后的模型替换容器内的模型

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐