错误:
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