#3780 OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack f

111.226* Posted at: 2 hours ago 👁6

Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 524, 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:/下载应用/win-pyvideotrans-v3.98-323_20260323_131320/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, Hu
......
for this kind of AutoModel: AutoModelForCTC.
Model type should be one of Data2VecAudioConfig, HubertConfig, MCTCTConfig, ParakeetCTCConfig, SEWConfig, SEWDConfig, UniSpeechConfig, UniSpeechSatConfig, Wav2Vec2Config, Wav2Vec2BertConfig, Wav2Vec2ConformerConfig, WavLMConfig.

while loading with AutoModelForSpeechSeq2Seq, 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 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:/下载应用/win-pyvideotrans-v3.98-323_20260323_131320/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:/下载应用/win-pyvideotrans-v3.98-323_20260323_131320/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:/下载应用/win-pyvideotrans-v3.98-323_20260323_131320/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:/下载应用/win-pyvideotrans-v3.98-323_20260323_131320/models/models--openai--whisper-large-v3.


=
system:Windows-10-10.0.22631-SP0
version:v3.98
frozen:True
language:zh
root_dir:D:/下载应用/win-pyvideotrans-v3.98-323_20260323_131320

1 Replies

这是由于本地语音识别模型文件下载不完整或损坏导致的。

错误信息显示软件尝试加载 openai--whisper-large-v3 模型,但在其目录中找不到有效的模型文件(如 pytorch_model.binmodel.safetensors)。这通常发生在自动下载模型因网络问题中断时。

解决方案:

  1. 手动下载并放置模型文件

    • 前往模型下载页面:https://huggingface.co/openai/whisper-large-v3/tree/main
    • 将该页面中的所有 .json.bin.safetensors.txt 文件下载到本地。
    • 在软件安装目录的 models 文件夹内,找到或创建名为 models--openai--whisper-large-v3 的文件夹。
    • 将下载的所有模型文件复制到该文件夹内。
  2. 切换语音识别渠道(临时解决方案)

    • 在软件主界面的“语音识别”下拉菜单中,暂时不要选择 openai-whisper(本地)
    • 可以改用 faster-whisper(本地) 渠道,并选择 large-v3 模型。该渠道模型下载地址不同,可能更稳定。
  3. 检查网络代理(如适用)

    • 如果自动下载其他模型也经常失败,可能是因为无法访问 HuggingFace。
    • 可以在软件主界面的“网络代理地址”中填写可用的代理地址(格式如 http://127.0.0.1:10808),或尝试使用国内镜像站手动下载。

预防与清理

  • 手动下载模型时,请确保下载完整,避免因网络波动导致文件缺失。
  • 如果问题持续,可以尝试删除 models/models--openai--whisper-large-v3 整个文件夹,然后重新启动软件,让它再次尝试自动下载(需确保网络通畅)。

请查阅相关文档:

Post Your Reply