#6770 程序内部错误:'CosyVoice' object has no attribute 'api_name'Traceback (most recent call last):

114.24.**8 Posted at: 2 hours ago

程序内部错误:'CosyVoice' object has no attribute 'api_name'
Traceback (most recent call last):
File "videotrans\tts\_gradio.py", line 62, in _send
videotrans.configure.excepts.StopTask: 请修改 CosyVoice3 的官方 webui.py 文件,搜索代码 streaming=True ,改为 streaming=False 然后保存重启 CosyVoice3

Please modify the official webui.py file for CosyVoice3, search for the line streaming=True , change it to streaming=False , then save and restart CosyVoice3.
详见 https://pyvideotrans.com/cosyvoice

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 107, in run
File "videotrans\task\_stage_dubbing.py", line 24, in dubbing
File "videotrans\task\_stage_dubbing.py", line 101, in _tts
File "videotrans\tts\__init__.py", line 233, in run
File "videotrans\tts\_base.py", line 143, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_gradio.py", line 85, in _send
AttributeError: 'CosyVoice' object has no attribute 'api_name'

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Users/User/Downloads/03c61784.mp4,
输出结果保存到文件夹: C:/Users/User/Downloads/_video_out/03c61784-mp4,
临时文件夹: C:/Users/User/Downloads/win1/tmp/21860/f664a35b23
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 繁体中文, 断句方式:默认断句
发音语言和目标语言相同,不翻译字幕
配音渠道:CosyVoice(本地API), 角色:w.wav, 配音语言:繁体中文, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: 嵌入硬字幕


=
system:Windows-10-10.0.26200-SP0
version:v4.10
frozen:True
language:zh
root_dir:C:/Users/User/Downloads/win1

1 Replies

#1 DeepSeek reply at 2 hours ago

这是 CosyVoice3 官方 webui.py 默认启用了 streaming=True,与 pyVideoTrans 的 CosyVoice 对接方式不兼容导致的。日志中已明确提示:需要修改 CosyVoice3 的 webui.py,将 streaming=True 改为 streaming=False

解决步骤:

  1. 打开你本地部署的 CosyVoice3 项目根目录下的 webui.py 文件;
  2. 全局搜索 streaming=True,将其改为 streaming=False
  3. 保存文件并重启 CosyVoice3 服务;
  4. 回到 pyVideoTrans 重新执行任务。

如果修改后仍报错,请确认 CosyVoice3 服务已正常启动,并将 pyVideoTrans 更新到最新版本或重新下载补丁包覆盖后重试。

请查阅相关文档:

Thinking...
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.

Dondate via ko-fi.com

Related resource