惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Vercel News
Vercel News
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
Help Net Security
Help Net Security
月光博客
月光博客
N
News and Events Feed by Topic
Cloudbric
Cloudbric
博客园 - 司徒正美
L
LangChain Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tenable Blog
The Register - Security
The Register - Security
The Hacker News
The Hacker News
I
InfoQ
The Last Watchdog
The Last Watchdog
MyScale Blog
MyScale Blog
Schneier on Security
Schneier on Security
WordPress大学
WordPress大学
小众软件
小众软件
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
宝玉的分享
宝玉的分享
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
K
Kaspersky official blog
L
LINUX DO - 热门话题
N
News | PayPal Newsroom
F
Fortinet All Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security @ Cisco Blogs
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
Google Online Security Blog
Google Online Security Blog
S
Schneier on Security
C
Cisco Blogs
N
News and Events Feed by Topic
V2EX - 技术
V2EX - 技术
Latest news
Latest news
PCI Perspectives
PCI Perspectives
T
The Blog of Author Tim Ferriss
P
Palo Alto Networks Blog
T
Tor Project blog
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Webroot Blog
Webroot Blog
Attack and Defense Labs
Attack and Defense Labs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org

Wulu's Blog

开放课程推荐 「面向所有人的 AI 提示词技巧」 2025 读书总结 树莓派5 优化与踩坑 在 Antigravity 使用 VS Code 应用扩展商店 树莓派安装 OpenWrt 及扩容教程 使用 Docker 在树莓派上安装 Moritx 下载工具 使用 Home Assistant 将米家设备接入 HomeKit 教程 Docker容器中的定时任务:使用Supercronic运行Python脚本 树莓派 | 欧路词典生词本 & 墨墨背单词 云同步教程 (eudic-maimemo-sync) 在 AI 时代,我为什么写博客? 记录 DIY 更换 CASIO G-SHOCK GBA-800 电池过程 2024 读书总结 使用 Audacity 制作立体音效果 使用 Audacity 进行音频降噪教程 Moonhack 2024: 缓解气候变化 谈谈 Follow 这款 RSS 阅读器 OpenAI Python API 新版本示例 使用HomeAssistant将米家设备接入到HomeKit AutoHotkey 脚本实现一键复制文本到 ChatGPT 提示模板 开放课程推荐 「面向开发者的 ChatGPT 提示词工程」 Api2d 国内可用的chatgpt api代理 利用chatgpt实现编程想法的实践-PyPower 树莓派安装docker版百度网盘 近期音乐分享 AI绘画 6PEN 人工智能艺术?
指定 Whisper 输出为简体中文
2023-05-16 · via Wulu's Blog

Whisper 支持直接输出srt格式的字幕文件。我最近用 Whisper 生成字幕文件,再配合ChatGPT 使用GPT-Subtrans 翻译字幕,整体效果很好。不过, Whisper有一个问题,就是Whisper 使用--language来指定语言,但无论是简体中文还是繁体中文,对应的代码都是zh。很多情况下,使用Whisper 生成字幕文件,设置参数--language zh,会生成繁体中文的字幕文件。

解决方案

在网上终于查到解决方案,分享给大家。 在 Whisper 的讨论区中,@jongwook 提出:

  1. 使用 --initial_prompt 参数,用简体中文输入 "以下是普通话的句子。" 就能生成简体中文字幕。(补充:whisper.cpp 用户可以尝试使用--prompt参数)
  2. 以此类推,用繁体中文输入 "以下是普通話的句子。" 就能得到繁体字幕。
$ whisper --language Chinese --model large audio.wav
[00:00.000 --> 00:08.000] 如果他们使用航空的方式运输货物在某些航线上可能要花几天的时间才能卸货和通关
$ whisper --language Chinese --model large audio.wav --initial_prompt "以下是普通話的句子。"  # traditional
[00:00.000 --> 00:08.000] 如果他們使用航空的方式運輸貨物,在某些航線上可能要花幾天的時間才能卸貨和通關。
$ whisper --language Chinese --model large audio.wav --initial_prompt "以下是普通话的句子。"  # simplified
[00:00.000 --> 00:08.000] 如果他们使用航空的方式运输货物,在某些航线上可能要花几天的时间才能卸货和通关。

另外,有关 --initial_prompt 参数,可在 openai的文档 查看更多。其中也提到 "有些语言可以用不同的方式书写,比如简体或繁体中文。模型可能默认不会使用你想要的转录写作风格。你可以通过使用你偏好的写作风格的提示来改善这一点。"。