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

作者 : admin 本文共612个字,预计阅读时间需要2分钟 发布时间: 2024-06-9 共2人阅读

错误:

Due to a bug fix in http://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'.

原始代码:

>>> transcriber.model.config.forced_decoder_ids = (
...   transcriber.tokenizer.get_decoder_prompt_ids(
...     language="zh",
...     task="transcribe"
...   )
... )

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

>>> transcriber.model.config.language="zh"
>>> transcriber.model.config.task="transcribe"
>>> transcriber.model.config.forced_decoder_ids=None
本站无任何商业行为
个人在线分享 » Due to a bug fix in http://github.com/huggingface/transformers/pull/28687
E-->