lenML / ChatTTS-Forge

🍦 ChatTTS-Forge is a project developed around TTS generation model, implementing an API Server and a Gradio-based WebUI.
https://huggingface.co/spaces/lenML/ChatTTS-Forge
GNU Affero General Public License v3.0
584 stars 71 forks source link

[BUG:API] 特殊符号&会报错 #77

Closed cpken closed 2 months ago

cpken commented 2 months ago

阅读 README.md 和 dependencies.md

检索 issue 和 discussion

检查 Forge 版本

Forge Commit 或者 Tag

Python 版本

3.11

PyTorch 版本

2.3.1+cu121

操作系统信息

ubuntu 22.04.1

BUG 描述

特殊符号&会报错

我输入以下文本内容,生成语音会报错:

报错:我&你,心连心。
不报错:我和你,心连心。

BUG 端点

文本输入

复现参数

我&你,心连心。

期望结果

能正常生成音频

实际结果

无内容输出,提示错误

错误信息

File "/media/depth/C4F6F040F6F033F0/lilei/ChatTTS-Forge/modules/repos_static/resemble_enhance/inference.py", line 154, in inference
    dwav = resample(
           ^^^^^^^^^
  File "ChatTTS-Forge/venv/lib/python3.11/site-packages/torchaudio/functional/functional.py", line 1530, in resample
    resampled = _apply_sinc_resample_kernel(waveform, orig_freq, new_freq, gcd, kernel, width)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "ChatTTS-Forge/venv/lib/python3.11/site-packages/torchaudio/functional/functional.py", line 1462, in _apply_sinc_resample_kernel
    waveform = waveform.view(-1, shape[-1])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: cannot reshape tensor of 0 elements into shape [-1, 0] because the unspecified dimension size -1 can be any value and is ambiguous
zhzLuke96 commented 2 months ago

fixed 85c98f69c149863fb7d6bb962110cdd034830885