#3198 TaskCfg(cache_folder='D:/A/tmp/31960/d08f146c6c', target_dir='d:/a/output/recogn', remove_noise=True, is_separate=False,

205.198* Posted at: 7 days ago 👁38

语音识别阶段出错 [Huggingface_ASR] Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 346, in pipe_asr
File "transformers\pipelines\__init__.py", line 1027, in pipeline

framework, model = infer_framework_load_model(

File "transformers\pipelines\base.py", line 333, in infer_framework_load_model

raise ValueError(

ValueError: Could not load model D:/A/models/models--openai--whisper-large-v3 with any of the following classes: (, , ). See the original errors:

while loading with AutoModelForCTC, an error is thrown:
Traceback (most recent call last):
File "transformers\pipelines\base.py", line 293, in infer_framework_load_model

model = model_class.from_pretrained(model, **kwargs)

File "transformers\models\auto\auto_factory.py", line 607, in from_pretrained

raise ValueError(

ValueError: Unrecognized configuration class for this kind of AutoModel: AutoModelForCTC.
Model type should be one of Data2VecAudioConfig, HubertConfig, MCTCTCo
......
model.msgpack found in directory D:/A/models/models--openai--whisper-large-v3.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "transformers\pipelines\base.py", line 311, in infer_framework_load_model

model = model_class.from_pretrained(model, **fp32_kwargs)

File "transformers\models\auto\auto_factory.py", line 604, in from_pretrained

return model_class.from_pretrained(

File "transformers\modeling_utils.py", line 277, in _wrapper

return func(*args, **kwargs)

File "transformers\modeling_utils.py", line 4900, in from_pretrained

checkpoint_files, sharded_metadata = _get_resolved_checkpoint_files(

File "transformers\modeling_utils.py", line 989, in _get_resolved_checkpoint_files

raise OSError(

OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory D:/A/models/models--openai--whisper-large-v3.

while loading with WhisperForConditionalGeneration, an error is thrown:
Traceback (most recent call last):
File "transformers\pipelines\base.py", line 293, in infer_framework_load_model

model = model_class.from_pretrained(model, **kwargs)

File "transformers\modeling_utils.py", line 277, in _wrapper

return func(*args, **kwargs)

File "transformers\modeling_utils.py", line 4900, in from_pretrained

checkpoint_files, sharded_metadata = _get_resolved_checkpoint_files(

File "transformers\modeling_utils.py", line 989, in _get_resolved_checkpoint_files

raise OSError(

OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory D:/A/models/models--openai--whisper-large-v3.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "transformers\pipelines\base.py", line 311, in infer_framework_load_model

model = model_class.from_pretrained(model, **fp32_kwargs)

File "transformers\modeling_utils.py", line 277, in _wrapper

return func(*args, **kwargs)

File "transformers\modeling_utils.py", line 4900, in from_pretrained

checkpoint_files, sharded_metadata = _get_resolved_checkpoint_files(

File "transformers\modeling_utils.py", line 989, in _get_resolved_checkpoint_files

raise OSError(

OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory D:/A/models/models--openai--whisper-large-v3.
TaskCfg(cache_folder='D:/A/tmp/31960/d08f146c6c', target_dir='d:/a/output/recogn', remove_noise=True, is_separate=False, detect_language='en', subtitle_language=None, source_language=None, target_language=None, source_language_code=None, target_language_code=None, source_sub=None, target_sub='d:/a/output/recogn/Naked Woman Thinks She Can Escape in the Ocean.srt', source_wav=None, source_wav_output=None, target_wav=None, target_wav_output=None, subtitles='', novoice_mp4=None, noextname='Naked Woman Thinks She Can Escape in the Ocean', shibie_audio='D:/A/tmp/31960/d08f146c6c/removed_noise_1770679008.9367945.wav', targetdir_mp4=None, instrument=None, vocal=None, back_audio=None, background_music=None, app_mode='biaozhun', subtitle_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role=None, copysrt_rawvideo=False, clear_cache=False, translate_type=None, tts_type=None, recogn_type=4, model_name='openai/whisper-large-v3', voice_autorate=False, video_autorate=False, cuda=True, name='D:/Naked Woman Thinks She Can Escape in the Ocean.mp4', basename='Naked Woman Thinks She Can Escape in the Ocean.mp4', ext='mp4', dirname='D:/', shound_del_name=None, uuid='d08f146c6c', remove_silent_mid=False, align_sub_audio=True, enable_diariz=True, nums_diariz=0, rephrase=0, only_out_mp4=False, fix_punc=True, recogn2pass=False)


=
system:Windows-10-10.0.26200-SP0
version:v3.96
frozen:True
language:zh
root_dir:D:/A

1 Replies

这是由于 HuggingFace_ASR 渠道尝试加载的 Whisper 模型文件不完整或下载失败导致的。错误信息显示在目录 D:/A/models/models--openai--whisper-large-v3 中找不到有效的模型文件(如 pytorch_model.binmodel.safetensors)。

解决方案:

  1. 检查并清理模型目录:前往 D:/A/models/,检查 models--openai--whisper-large-v3 文件夹。如果该文件夹为空或文件明显不完整,请将其删除。
  2. 配置网络代理:由于 HuggingFace 在国内访问困难,请在 pyVideoTrans 的“设置”或“高级选项”中配置网络代理地址,以帮助软件自动下载模型。
  3. 手动下载模型(推荐)

    • 从 HuggingFace 镜像站(如 hf-mirror.com)手动下载 openai/whisper-large-v3 的模型文件。
    • 将下载的完整模型文件(包含 config.json, pytorch_model.binmodel.safetensors 等)放入 D:/A/models/models--openai--whisper-large-v3/ 目录中。请确保文件夹命名完全一致
  4. 更换语音识别渠道:作为临时解决方案,可以切换到其他语音识别渠道,例如 faster-whisper(本地)或使用在线 API(如 OpenAI Whisper API)。

请查阅相关文档:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Related resource