生产优先、生产就绪的端到端语音识别工具包
| 文档 | 论文 | 运行时 | 预训练模型 | HuggingFace | 咨询 WeNet Guru
我们共同分享网络。
pip install git+https://github.com/wenet-e2e/wenet.git这会引入 torch>=1.13.0 且没有上限,因此 pip 可能会安装一个比你已安装的 GPU 驱动所支持的版本更新的 torch 版本。如果你打算使用 GPU,请在安装后进行验证:
python -c "import torch; print(torch.cuda.is_available())"如果在有 GPU 的机器上输出 False,torch 会静默回退到 CPU,不会报错。请重新安装与你驱动所支持的 CUDA 版本相匹配的 torch 版本,例如:
pip install torch==2.4.0+cu121 torchaudio==2.4.0+cu121 --index-url https://download.pytorch.org/whl/cu121 --force-reinstall命令行用法(使用 -h 查看参数):
wenet -m paraformer audio.wav你可以将 -m 设置为 paraformer、firered 或 wenetspeech 以用于中文,或将其设置为 whisper-large-v3 或 whisper-large-v3-turbo 以用于英文。
注意:默认在 CPU 上运行(--device 默认为 cpu),即使有可用的 GPU 也是如此。请显式传入 --device cuda 来使用 GPU(Python API:wenet.load_model(model_name, device='cuda'))。有关 dtype 和 attention-backend 选项,请参阅 Tesla T4)的特定说明。
Python 编程用法:
import wenet
model = wenet.load_model('paraformer')
result = model.transcribe('audio.wav')
print(result.te
[**Roadmap**](https://github.com/wenet-e2e/wenet/issues/1683)
[python usage](docs/python_package.md#gpuhardware-notes) for GPU/Turing (e.g.暂无开放 Issues,或尚未同步最近议题。