Whisper 模型本地化部署指南
一、模型版本与下载
Whisper 提供多种规模版本,可通过以下官方渠道获取:
- GitHub 仓库
https://github.com/openai/whisper
包含最新代码、预训练权重和文档
tiny.en/tinybase.en/basesmall.en/smallmedium.en/mediumlarge-v2(最新大模型)
Hugging Face 模型库 所有版本下载路径:
https://huggingface.co/openai/whisper-{version}/tree/main
替换 {version} 为具体型号。
二、离线环境搭建教程
准备工作
- 硬件要求:
- GPU 推荐:NVIDIA GTX 1080 或更高
- 显存要求:
- 小模型:≥ 2GB
- 大模型:≥ 10GB
基础环境:
# 安装 Python 3.8+
sudo apt install python3.8 python3-pip
# 创建虚拟环境
python3 -m venv whisper-env
source whisper-env/bin/activate
离线依赖安装
离线安装:
pip install --no-index --find-links=/path/to/wheels -r requirements.txt
下载依赖包(在联网设备操作):
pip download -r requirements.txt --platform manylinux2014_x86_64 --only-binary=:all: --python-version 3.8
将生成的 *.whl 文件复制到离线设备。
模型部署
- 手动下载模型:
- 从 Hugging Face 下载
.pt权重文件 - 保存路径:
~/.cache/whisper/
- 从 Hugging Face 下载
验证安装:
import whisper
model = whisper.load_model("base")
result = model.transcribe()
(result[])

