zhaomaoniu / nonebot-plugin-gpt-sovits

✨ NoneBot2 Plugin for GPT-SoVITS ✨
MIT License
7 stars 1 forks source link

gpt_sovits_emotion_map路径报错 #3

Open WillowKoishi opened 6 hours ago

WillowKoishi commented 6 hours ago

.env.prod 内:

GPT_SOVITS_EMOTION_MAP='[ { "name": "平静", "sentences": [ {"text": "アリス、知ってます。世の中には、メイドカフェというものがあるらしいです。", "language": "ja", "path": "C:\Users\Administrator\shiinano\ttt1.wav"} ] }, { "name": "激动", "sentences": [ {"text": "アイテム倉庫の管理もメイドのお仕事です。アリス、今日も頑張ります!", "language": "ja", "path": "C:\Users\Administrator\shiinano\ttt5.wav"} ] } ]'

其中path一栏已经试过“file:///C:\Users\Administrator\shiinano\ttt5.wav”、“ttt5.wav”均会报错

运行后必报错:

10-20 09:50:28 [ERROR] nonebot | Failed to import "nonebot_plugin_gpt_sovits" Traceback (most recent call last): File "", line 14, in File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\plugin\load.py", line 131, in load_from_toml return load_all_plugins(plugins, plugin_dirs) File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\plugin\load.py", line 65, in load_all_plugins return manager.load_all_plugins() File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\plugin\manager.py", line 203, in load_all_plugins return set( File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\plugin\manager.py", line 204, in filter(None, (self.load_plugin(name) for name in self.available_plugins))

File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\plugin\manager.py", line 167, in load_plugin module = importlib.import_module(self._third_party_plugin_ids[name]) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\importlib__init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1206, in _gcd_import File "", line 1178, in _find_and_load File "", line 1149, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\plugin\manager.py", line 255, in exec_module super().exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot_plugin_gpt_sovits__init__.py", line 24, in plugin_config = nonebot.get_plugin_config(Config) File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\plugin\init.py", line 173, in get_plugin_config return type_validate_python(config, model_dump(get_driver().config)) File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\compat.py", line 372, in type_validate_python return parse_objas(type, data) File "pydantic\tools.py", line 38, in pydantic.tools.parse_obj_as return model_type(root=obj).root File "pydantic\main.py", line 341, in pydantic.main.BaseModel.init raise validation_error pydantic.error_wrappers.ValidationError: 1 validation error for ParsingModel[Config] root__ -> gpt_sovits_emotion_map value is not a valid list (type=type_error.list)

zhaomaoniu commented 6 hours ago

这不是路径问题,而是配置问题。路径填写绝对路径即可。 能否打开 DEBUG 日志,将 Bot 启动时输出的配置信息中的 gpt_sovits_emotion_map 的值提供一下?

WillowKoishi commented 5 hours ago

你好,将路径内的所有“\”改为"/"后,即"C://Users/Administrator/shiinano/ttt5.wav",之后就无该类型报错,但是产生了新的报错,内容如下:

10-20 11:12:05 [SUCCESS] nonebot | OneBot V11 2918721136 | [message.private.friend]: Message 1415752631 from 1033855007 '锘 说话 测试' 10-20 11:12:05 [INFO] nonebot | Event will be handled by Matcher(type='message', module=xunsi.plugins.auto_chat, lineno=94) 10-20 11:12:05 [INFO] nonebot | Matcher(type='message', module=xunsi.plugins.auto_chat, lineno=94) running complete 10-20 11:12:05 [INFO] nonebot | Event will be handled by AlconnaMatcher(type='', module=nonebot_plugin_gpt_sovits, lineno=51) 10-20 11:12:05 [INFO] nonebot | AlconnaMatcher(type='', module=nonebot_plugin_gpt_sovits, lineno=51) running complete 10-20 11:12:05 [ERROR] nonebot | Running AlconnaMatcher(type='', module=nonebot_plugin_gpt_sovits, lineno=51) failed. Traceback (most recent call last): File "", line 17, in File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot__init__.py", line 335, in run get_driver().run(*args, *kwargs) File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 186, in run uvicorn.run( File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\uvicorn\main.py", line 577, in run server.run() File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\uvicorn\server.py", line 65, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1922, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\message.py", line 476, in check_and_run_matcher await _run_matcher(

File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\message.py", line 428, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 850, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 825, in simple_run await handler( File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot\dependencies__init.py", line 94, in call__ return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot_plugin_gpt_sovits__init__.py", line 162, in handle_tts duration = int(get_wav_duration(wav_file)) File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\nonebot_plugin_gpt_sovits\utils.py", line 130, in get_wav_duration audio = AudioSegment.from_file(io.BytesIO(wav_bytes), format="wav") File "C:\Users\Administrator\shiinano.venv\Lib\site-packages\pydub\audio_segment.py", line 773, in from_file raise CouldntDecodeError( pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 3199971767

Output from ffmpeg/avlib:

ffmpeg version 7.1-essentials_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14.2.0 (Rev1, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband libavutil 59. 39.100 / 59. 39.100 libavcodec 61. 19.100 / 61. 19.100 libavformat 61. 7.100 / 61. 7.100 libavdevice 61. 3.100 / 61. 3.100 libavfilter 10. 4.100 / 10. 4.100 libswscale 8. 3.100 / 8. 3.100 libswresample 5. 3.100 / 5. 3.100 libpostproc 58. 3.100 / 58. 3.100 [wav @ 0000025b7796fb80] invalid start code [123][34]de in RIFF header [cache @ 0000025b77970180] Statistics, cache hits:0 cache misses:1 [in#0 @ 0000025b7796f780] Error opening input: Invalid data found when processing input Error opening input file cache:pipe:0. Error opening input files: Invalid data found when processing input

zhaomaoniu commented 5 hours ago

能否截图一下GPT-SoVITS的日志?

WillowKoishi commented 3 hours ago

GPT-SoVITS一侧没有任何日志输出,你是指GPT-SoVITS初始化时的日志吗 初始化时的日志为:

G:\GPT-SoVITS-v2-240821>runtime\python.exe webui.py zh_CN Running on local URL: http://0.0.0.0:9874 "G:\GPT-SoVITS-v2-240821\runtime\python.exe" GPT_SoVITS/inference_webui_fast.py "zh_CN" ---------------------------------------------TTS Config--------------------------------------------- device : cpu is_half : False version : v2 t2s_weights_path : GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt vits_weights_path : SoVITS_weights_v2/Aris_e15_s405.pth bert_base_path : GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large cnhuhbert_base_path : GPT_SoVITS/pretrained_models/chinese-hubert-base

Loading Text2Semantic weights from GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt Loading VITS weights from SoVITS_weights_v2/Aris_e15_s405.pth Loading BERT weights from GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large Loading CNHuBERT weights from GPT_SoVITS/pretrained_models/chinese-hubert-base Running on local URL: http://0.0.0.0:9872 IMPORTANT: You are using gradio version 4.24.0, however version 4.44.1 is available, please upgrade.

zhaomaoniu commented 3 hours ago

请使用 api_v2.py 来对接本项目,而不是 webui.py

具体配置方法,请参阅 api_v2.py 开头的 WebAPI文档