Due to a bug fix in https://github.com/huggingface/transformers/pull/28687

错误:

Due to a bug fix in https://github.com/huggingface/transformers/pull/28687 transcription using a multilingual Whisper will default to language detection followed by transcription instead of translation to English.This might be a breaking change for your use case. If you want to instead always translate your audio to English, make sure to pass language='en'.

原始代码:

bash 复制代码
>>> transcriber.model.config.forced_decoder_ids = (
...   transcriber.tokenizer.get_decoder_prompt_ids(
...     language="zh",
...     task="transcribe"
...   )
... )

解决方法:上述代码修改为如下代码。

bash 复制代码
>>> transcriber.model.config.language="zh"
>>> transcriber.model.config.task="transcribe"
>>> transcriber.model.config.forced_decoder_ids=None
相关推荐
癫狂的兔子1 天前
【BUG】【Python】逆序取值为空
bug
癫狂的兔子1 天前
【BUG】【Python】精确度问题
python·bug
癫狂的兔子1 天前
【BUG】【Python】合并两个列表
bug
癫狂的兔子1 天前
【BUG】【Python】eval()报错
python·bug
余生H1 天前
Ai编程翻车修车记3 -一次因为移除监听器失败导致bug后的DOM事件深入学习
学习·bug·ai编程
癫狂的兔子1 天前
【BUG】【Python】list切片和list.reverse()的区别
bug
gladiator+2 天前
Weblog项目bug合集
bug
workflower3 天前
小强地狱(Bug Hell)
大数据·bug·团队开发·需求分析·个人开发·结对编程
万粉变现经纪人3 天前
Python系列Bug修复PyCharm控制台pip install报错:如何解决 pip install 网络报错 企业网关拦截 User-Agent 问题
网络·python·pycharm·beautifulsoup·bug·pandas·pip
燕双嘤3 天前
Bug:Nginx 转发末尾斜杠导致 404 问题分析
bug