当前位置: 代码网 > it编程>前端脚本>Python > whisper-large-v3:速度快的令人翻译模型三种实用的调用方法

whisper-large-v3:速度快的令人翻译模型三种实用的调用方法

2024年07月28日 Python 我要评论
2、whisper-large-v3基础上chenxwh 制作了开源库insanely-fast-whisper ,可本地指令运行,或 Google Colab T4 GPU 运行;1、《【本地开源】whisper-large-v3:速度快得令人难以置信的翻译模型,分享三种实用的调用方法》作者:万能君软件库。3、以上两个模型应用,如果觉得使用复杂难度大,国内软件工程师制作了更简单的版本fast-whisper3。1、whisper-large-v3 是openai公司的模型,可使用Python代码调用;

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:速度快得令人难以置信的翻译模型,分享三种实用的调用方法》作者:万能君软件库

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com