whisper large-v3 模型文件下载链接

python 复制代码
#源码里找到的

_MODELS = {
    "tiny.en": "https://openaipublic.azureedge.net/main/whisper/models/d3dd57d32accea0b295c96e26691aa14d8822fac7d9d27d5dc00b4ca2826dd03/tiny.en.pt",
    "tiny": "https://openaipublic.azureedge.net/main/whisper/models/65147644a518d12f04e32d6f3b26facc3f8dd46e5390956a9424a650c0ce22b9/tiny.pt",
    "base.en": "https://openaipublic.azureedge.net/main/whisper/models/25a8566e1d0c1e2231d1c762132cd20e0f96a85d16145c3a00adf5d1ac670ead/base.en.pt",
    "base": "https://openaipublic.azureedge.net/main/whisper/models/ed3a0b6b1c0edf879ad9b11b1af5a0e6ab5db9205f891f668f8b0e6c6326e34e/base.pt",
    "small.en": "https://openaipublic.azureedge.net/main/whisper/models/f953ad0fd29cacd07d5a9eda5624af0f6bcf2258be67c92b79389873d91e0872/small.en.pt",
    "small": "https://openaipublic.azureedge.net/main/whisper/models/9ecf779972d90ba49c06d968637d720dd632c55bbf19d441fb42bf17a411e794/small.pt",
    "medium.en": "https://openaipublic.azureedge.net/main/whisper/models/d7440d1dc186f76616474e0ff0b3b6b879abc9d1a4926b7adfa41db2d497ab4f/medium.en.pt",
    "medium": "https://openaipublic.azureedge.net/main/whisper/models/345ae4da62f9b3d59415adc60127b97c714f32e89e936602e85993674d08dcb1/medium.pt",
    "large-v1": "https://openaipublic.azureedge.net/main/whisper/models/e4b87e7e0bf463eb8e6956e646f1e277e901512310def2c24bf0e11bd3c28e9a/large-v1.pt",
    "large-v2": "https://openaipublic.azureedge.net/main/whisper/models/81f7c96c852ee8fc832187b0132e569d6c3065a3252ed18e56effd0b6a73e524/large-v2.pt",
    "large-v3": "https://openaipublic.azureedge.net/main/whisper/models/e5b1a55b89c1367dacf97e3e19bfd829a01529dbfdeefa8caeb59b3f1b81dadb/large-v3.pt",
    "large": "https://openaipublic.azureedge.net/main/whisper/models/e5b1a55b89c1367dacf97e3e19bfd829a01529dbfdeefa8caeb59b3f1b81dadb/large-v3.pt",
}

加速下载

aria2c -x 16 https://openaipublic.azureedge.net/main/whisper/models/e5b1a55b89c1367dacf97e3e19bfd829a01529dbfdeefa8caeb59b3f1b81dadb/large-v3.pt --all-proxy=http://host.docker.internal:7890

我这是在容器里用代理,代理选项可去除

这是gpt4给我的代码:

我想写一个python程序,在我发出"过"的语音时,打印"过"(实际上是执行某种操作,我会将它嵌入到其他程序中,目前只打印字符串),在我发出"下一个"的语音时,打印"下一个",我想使用https://huggingface.co/openai/whisper-large-v3实现

python 复制代码
import whisper
import sounddevice as sd
import numpy as np

# 录音设置
duration = 5  # 录音时长(秒)
samplerate = 16000  # 采样率


def record_audio(duration, samplerate):
    """录制音频"""
    recording = sd.rec(
        int(duration * samplerate), samplerate=samplerate, channels=1, dtype="float32"
    )
    sd.wait()
    return recording


def transcribe_audio(audio, model):
    """使用Whisper模型转录音频"""
    audio = np.squeeze(audio)  # 确保音频是一维的
    result = model.transcribe(audio)
    return result["text"]


def main():
    # 加载Whisper模型
    model = whisper.load_model("large-v3")

    while True:
        print("开始录音...")
        audio = record_audio(duration, samplerate)
        print("录音结束,正在识别...")

        # 识别语音
        text = transcribe_audio(audio, model)

        # 根据识别结果执行操作
        if "过" in text:
            print("过")
        elif "下一个" in text:
            print("下一个")
        else:
            print("未识别到指令")
            print(text)


if __name__ == "__main__":
    main()
相关推荐
石臻臻的杂货铺1 天前
推荐几个常用免费的文本转语音工具
人工智能·语音识别
q_q王1 天前
‌FunASR‌阿里开源的语音识别工具
python·大模型·llm·语音识别
我在北国不背锅2 天前
解决LangChain4j报错HTTP/1.1 header parser received no bytes
openai·langchain4j
打小就很皮...3 天前
使用 React 实现语音识别并转换功能
人工智能·语音识别
会游泳的石头3 天前
在Java项目中实现本地语音识别与热点检测,并集成阿里云智能语音服务(优化版)
阿里云·语音识别·xcode
Hello server5 天前
利用 Python pyttsx3实现文字转语音(TTS)
python·学习·语音识别
limingade6 天前
手机打电话时由对方DTMF响应切换多级IVR语音应答(一)
人工智能·语音识别·手机实现来电ivr导航·多级ivr语音导航
create177 天前
使用 AI 如何高效解析视频内容?生成思维导图或分时段概括总结
人工智能·aigc·语音识别·ai写作
碣石潇湘无限路7 天前
【AI】基于生活案例的LLM强化学习(入门帖)
人工智能·经验分享·笔记·生活·openai·强化学习
limingade8 天前
手机SIM卡打电话时识别对方按下的DTMF按键(二)
智能手机·语音识别·dtmf识别·dtmf解码器·sim卡通话识别dtmf·手机通话识别dtmf·手机通话语音拦截