RVC-Boss / GPT-SoVITS

1 min voice data can also be used to train a good TTS model! (few shot voice cloning)
MIT License
32.47k stars 3.74k forks source link

文本中有字母和符号报错了 #1349

Open youyos opened 1 month ago

youyos commented 1 month ago

需要转的文本:怎样求解一元二次方程AX²+BX+C=0的根。

Actual Input Reference Text: 大家好,今天我想和大家分享一个。
Actual Input Target Text: 怎样求解一元二次方程AX²+BX+C=0的根。
Actual Input Target Text (after sentence segmentation): 怎样求解一元二次方程AX²+BX+C=0的根。
Building prefix dict from the default dictionary ...
DEBUG:jieba_fast:Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
DEBUG:jieba_fast:Loading model from cache /tmp/jieba.cache
Loading model cost 0.836 seconds.
DEBUG:jieba_fast:Loading model cost 0.836 seconds.
Prefix dict has been built succesfully.
DEBUG:jieba_fast:Prefix dict has been built succesfully.
------phones:[127, 100, 221, 171, 158, 119, 1, 221, 196, 252, 176, 316, 231, 317, 183, 158, 131, 127, 100, 221, 171, 155, 140, 317, 183, 318, 167, 156, 134, 3], word2ph:[2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1], norm_text:大家好,今天我想和大家分享一个.
Actual Input Target Text (per sentence): 怎样求解一元二次方程AX²+BX+C=0的根。
['怎样求解一元二次方程', 'A X ', '²+', 'B X+C= ', '0的根。']
['zh', 'en', 'zh', 'en', 'zh']
------phones:[319, 142, 318, 115, 247, 217, 221, 193, 318, 169, 318, 302, 33, 153, 124, 164, 155, 112, 125, 146], word2ph:[2, 2, 2, 2, 2, 2, 2, 2, 2, 2], norm_text:怎样求解一元二次方程
------phones:[42, 35, 61, 75], word2ph:None, norm_text:A X 
------phones:[], word2ph:[], norm_text:
Traceback (most recent call last):
  File "/mnt/workspace/GPT-SoVITS/GPT_SoVITS/inference_cli.py", line 54, in <module>
    main()
  File "/mnt/workspace/GPT-SoVITS/GPT_SoVITS/inference_cli.py", line 51, in main
    synthesize(args.gpt_model, args.sovits_model, args.ref_audio, args.ref_text, args.ref_language, args.target_text, args.target_language, args.output_path)
  File "/mnt/workspace/GPT-SoVITS/GPT_SoVITS/inference_cli.py", line 30, in synthesize
    result_list = list(synthesis_result)
  File "/mnt/workspace/GPT-SoVITS/GPT_SoVITS/inference_webui.py", line 390, in get_tts_wav
    phones2,bert2,norm_text2=get_phones_and_bert(text, text_language)
  File "/mnt/workspace/GPT-SoVITS/GPT_SoVITS/inference_webui.py", line 288, in get_phones_and_bert
    bert = get_bert_inf(phones, word2ph, norm_text, lang)
  File "/mnt/workspace/GPT-SoVITS/GPT_SoVITS/inference_webui.py", line 222, in get_bert_inf
    bert = get_bert_feature(norm_text, word2ph).to(device)#.to(dtype)
  File "/mnt/workspace/GPT-SoVITS/GPT_SoVITS/inference_webui.py", line 100, in get_bert_feature
    phone_level_feature = torch.cat(phone_level_feature, dim=0)
RuntimeError: torch.cat(): expected a non-empty list of Tensors
IMPORTANT: You are using gradio version 3.38.0, however version 4.29.0 is available, please upgrade.
--------
ctrlcplusv commented 1 month ago

我觉得问题出在'²+'这里,'²+'对应的语言是zh,但这不是中文符号,导致G2P出错

SapphireLab commented 1 month ago

复现了,带平方的单位是有处理的,单独的 ² 平方 ³ 立方没有做处理。+= 似乎也没有,@KamioRinn 佬解决一下。

暂时可以考虑先自己处理成 A x 平方加 B x 加 C 等于零 让它合成。

RVC-Boss commented 1 month ago

用最新代码试试

KamioRinn commented 1 month ago

用新代码的中文跑,不需要中英混合处理公式

youyos commented 1 month ago

今天使用了新代码跑了,报错的问题确实已解决。 image

首先是更新了一下gradio的版本,但是途中启动服务的时候还是有遇到这个错误

Traceback (most recent call last):
  File "/mnt/workspace/GPT-SoVITS/webui.py", line 876, in <module>
    app.queue(concurrency_count=511, max_size=1022).launch(
  File "/home/pai/envs/sovits/lib/python3.9/site-packages/gradio/blocks.py", line 2117, in queue
    raise DeprecationWarning(
DeprecationWarning: concurrency_count has been deprecated. Set the concurrency_limit directly on event listeners e.g. btn.click(fn, ..., concurrency_limit=10) or gr.Interface(concurrency_limit=10). If necessary, the total number of workers can be configured via `max_threads` in launch().

我是去掉concurrency_count参数才成功的,app.queue(max_size=1022).launch

XXXXRT666 commented 1 month ago

gradio版本不要动

youyos commented 1 month ago

gradio版本不要动

貌似有个警告,所以我就升级了,不过去掉concurrency_count参数也可以启动