1、whisper-large-v3 是openai公司的模型,可使用Python代码调用;

2、whisper-large-v3基础上chenxwh 制作了开源库insanely-fast-whisper ,可本地指令运行,或 Google Colab T4 GPU 运行;

3、以上两个模型应用,如果觉得使用复杂难度大,国内软件工程师制作了更简单的版本fast-whisper3。

以下分三部分介绍:

开源库

insanely-fast-whisper

https://github.com/chenxwh/insanely-fast-whisper

使用 OpenAI 的 Whisper Large v3 在不到 98 秒的时间内转录 300 分钟(5 小时)的音频。

insanely-fast-whisper

本地安装

1、pip install pipx

2、pipx install insanely-fast-whisper

默认路径:

C:\Users\Administrator\AppData\Local\pipx\pipx\venvs\insanely-fast-whisper

3、运行(cmd)

- 路径:

C:\Users\Administrator\AppData\Local\pipx\pipx\venvs\insanely-fast-whisper\Scripts

- 指令:

insanely-fast-whisper --file-name e:\huang.mp3

usage: insanely-fast-whisper.exe [-h] 

[--file-name FILE_NAME ]

[--device-id DEVICE_ID]                                

[--transcript-path TRANSCRIPT_PATH] 

[--model-name MODEL_NAME]

[--task {transcribe,translate}]

[--language LANGUAGE]

[--batch-size BATCH_SIZE]                                 

[--flash FLASH] 

[--timestamp {chunk,word}] 

[--hf_token HF_TOKEN]                                 

[--diarization_model DIARIZATION_MODEL]

二  另一个分享

在开源whisper上加工,打包的翻译软件

更简单,更方便

large-v3

夸克网盘链接:https://pan.quark.cn/s/82b36b6adfa7提取码:JsyQ

Whisper

命令行使用

(例)

1、使用medium模型转录音频文件中的语音:

whisper audio.flac audio.mp3 audio.wav --model medium

2、指定语言--language

whisper japanese.wav --language Japanese(cantonese)

3、--task translate会将演讲翻译成英语

whisper japanese.wav --language Japanese --task translate

4、查看所有可用选项

whisper --help

5、python使用

import whisper

model = whisper.load_model("base")

result = model.transcribe("huang.mp3")

print(result["text"])

6、python安装whisper

pip install -U openai-whisper

或者

7、python 升级whisper

pip install --upgrade --no-deps --force-reinstall git+https://github.com/openai/whisper.git

pip install git+https://github.com/openai/whisper.git 

参考文献:

1、《【本地开源】whisper-large-v3:速度快得令人难以置信的翻译模型,分享三种实用的调用方法》作者:万能君软件库

相关链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: