体验 Whisper
- 1. 什么是 Whisper
 - 2. Github 地址
 - 3. 创建虚拟环境
 - 4. 安装 ffmpeg
 - 5. 部署 Whisper
 - 6. 使用 Whisper
 
1. 什么是 Whisper
Whisper 是一个通用的语音识别模型。它是在一个大型的不同音频数据集上训练出来的,也是一个多任务模型,可以进行多语言语音识别(multilingual speech recognition)、语音翻译(speech translation)和语言识别(language identification)。
2. Github 地址
https://github.com/openai/whisper
3. 创建虚拟环境
conda create -n whisper python==3.10.6
conda activate whisper 
 
4. 安装 ffmpeg
sudo apt update && sudo apt install ffmpeg
 
5. 部署 Whisper
克隆代码库,
git clone https://github.com/openai/whisper.git; cd whisper/
 
安装依赖,
pip3 install -r requirements.txt
pip3 install -U openai-whisper
pip3 install git+https://github.com/openai/whisper.git 
pip3 install --upgrade --no-deps --force-reinstall git+https://github.com/openai/whisper.git
pip3 install setuptools-rust
 
(可选)我使用的是 WSL-Ubuntu 22.04,安装的 CUDA Toolkit 11.8,将 pytorch、torchvision、torchaudio 更新为兼容 CUDA Toolkit 11.8 的版本。
pip3 uninstall pytorch torchvision torchaudio && pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
 
6. 使用 Whisper
这里我录制了一句中文,测试一下效果,
whisper demo.wav --model medium --language Chinese
 
输出如下,

 完结!



















