开源语音识别faster-whisper部署教程

1. 资源下载

源码地址

模型下载地址:

markdown 复制代码
large-v3模型:https://huggingface.co/Systran/faster-whisper-large-v3/tree/main
large-v2模型:https://huggingface.co/guillaumekln/faster-whisper-large-v2/tree/main
large-v2模型:https://huggingface.co/guillaumekln/faster-whisper-large-v1/tree/main
medium模型:https://huggingface.co/guillaumekln/faster-whisper-medium/tree/main
small模型:https://huggingface.co/guillaumekln/faster-whisper-small/tree/main
base模型:https://huggingface.co/guillaumekln/faster-whisper-base/tree/main
tiny模型:https://huggingface.co/guillaumekln/faster-whisper-tiny/tree/main

下载cuBLAS and cuDNN

shell 复制代码
https://github.com/Purfview/whisper-standalone-win/releases/tag/libs

2. 创建环境

conda环境中创建python运行环境

shell 复制代码
conda create -n faster_whisper python=3.9 # python版本要求3.8到3.11

激活虚拟环境

shell 复制代码
conda activate faster_whisper

安装faster-whisper依赖

shell 复制代码
pip install faster-whisper

3. 运行

执行完以上步骤后,我们可以写代码了

python 复制代码
from faster_whisper import WhisperModel

model_size = "large-v3"

path = r"D:\Works\Python\Faster_Whisper\model\small"

# Run on GPU with FP16
model = WhisperModel(model_size_or_path=path, device="cuda", local_files_only=True)

# or run on GPU with INT8
# model = WhisperModel(model_size, device="cuda", compute_type="int8_float16")
# or run on CPU with INT8
# model = WhisperModel(model_size, device="cpu", compute_type="int8")

segments, info = model.transcribe("C:\\Users\\21316\\Documents\\录音\\test.wav", beam_size=5, language="zh", vad_filter=True, vad_parameters=dict(min_silence_duration_ms=1000))

print("Detected language '%s' with probability %f" % (info.language, info.language_probability))

for segment in segments:
    print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))

说明:

markdown 复制代码
local_files_only=True 表示加载本地模型
model_size_or_path=path 指定加载模型路径
device="cuda" 指定使用cuda
compute_type="int8_float16" 量化为8位
language="zh" 指定音频语言
vad_filter=True 开启vad
vad_parameters=dict(min_silence_duration_ms=1000) 设置vad参数

更多内容欢迎访问博客

对应视频内容欢迎访问视频

相关推荐
tianxiaxue120 小时前
企微如何使用AI生成推荐话术?
人工智能·企业微信
团象科技20 小时前
梳理中小出海独立站落地阶段关于WordPress 海外主机的实操参考路径
人工智能·深度学习
朴马丁21 小时前
构建日化数字创新平台:PLM如何融合AI、物联网数据,驱动智能研发与精准营销
人工智能·物联网·流程行业plm·日化行业
我不介意孤独21 小时前
04-记忆系统为什么向量数据库不够用
数据库·人工智能·资源隔离·agent infra
CTA终结者21 小时前
期货开仓前保证金够吗:get_account 可用与占用字段对照
python·区块链
开源量化GO21 小时前
夜盘白盘衔接几分钟误下单:天勤交易时段与行情过滤
python·区块链
小程故事多_8021 小时前
从人工编写到自主迭代进化,SkillEvolver重构大模型智能体技能生成新范式
人工智能·重构
wengad21 小时前
机器学习实践理论基础|算法、模型和数据集
人工智能·算法·机器学习
kishu_iOS&AI21 小时前
LLM —— Prompt提示词工程
人工智能·prompt
li-xun21 小时前
2026年6月7日博客精选
人工智能·chatgpt·每日阅读