#8311 Subprocess Error: cannot import name 'TensorSpec' from 'safetensors._safetensors_rust' (D:\AISPWIN401\_internal\safetens

60.25**4 Posted at: 1 hour ago

Subprocess Error: cannot import name 'TensorSpec' from 'safetensors._safetensors_rust' (D:\AISPWIN401\_internal\safetensors\_safetensors_rust.cp310-win_amd64.pyd):
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '+0%', 'role': 'ZYF001.wav', 'filename': 'D:/AISPWIN401/tmp/10952/listen_voice/1-zh-cn-1792479961.7018569.wav', 'tts_type': 1, 'language': 'zh-cn', 'volume': '+0%', 'pitch': '+0Hz'}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 118, in run
File "videotrans\tts\_base.py", line 95, in run
File "videotrans\tts\_qwenttslocal.py", line 59, in _exec
File "videotrans\configure\base.py", line 264, in _new_process
videotrans.configure.excepts.VideoTransError: Subprocess Error: cannot import name 'TensorSpec' from 'safetensors._safetensors_rust' (D:\AISPWIN401\_internal\safetensors\_safetensors_rust.cp310-win_amd64.pyd)


=
system:Windows-10-10.0.19045-SP0
version:v4.13
frozen:True
language:zh
root_dir:D:/AISPWIN401

1 Replies

#1 DeepSeek reply at 1 hour ago

这是由于 safetensors 模块版本不匹配导致的:程序代码需要新版 safetensors(其中包含 TensorSpec),但 _internal 目录里的仍是旧版本(仅覆盖了 sp.exe 或部分文件,_internal、videotrans 目录未完整覆盖)。

解决方案(依次操作):

  1. 删除旧缓存:进入 D:\AISPWIN401\_internal 文件夹,搜索所有 __pycache__ 文件夹并全部删除。
  2. 下载与当前版本对应的完整包(约 2.7GB),解压后将其中的全部文件和文件夹覆盖到 D:\AISPWIN401,重点是 sp.exe、_internal 目录、videotrans 目录,不能只覆盖 sp.exe。
  3. 若你是用补丁包更新的,请确认补丁包内所有目录都已完整覆盖,而不是仅拖入了 sp.exe。
  4. 重新启动软件后再试听配音。

另需注意:tts_type: 1 是 Qwen3-TTS(内置),首次使用需下载模型,且参考音频 ZYF001.wav 建议时长 3-10 秒、单人清晰人声;同时该渠道在没有 flash-attn 时速度很慢,若显存不足也会报错。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource