1.链接:git clone https://github.com/2noise/ChatTTS.git
2.遇到'nomalizer'问题,直接pip install nemo_text_processing,pynini,WeTextProcessing,这在linux无问题,windows有问题
解决办法:
在chatTTS里面的core.py:
143行到149行注释掉:
# if do_text_normalization:
# for i, t in enumerate(text):
# _lang = detect_language(t) if lang is None else lang
# self.init_normalizer(_lang)
# text[i] = self.normalizer[_lang](t)
# if _lang == 'zh':
# text[i] = apply_half2full_map(text[i])
3.huggingface连接问题,在Google colab无问题可连接,但本地出现梯子代理问题,尚未解决
替代解决:
使用以下代码
from modelscope import snapshot_download
model_dir = snapshot_download('mirror013/ChatTTS')
# # 加载模型
chat = ChatTTS.Chat()
chat.load_models(
source="local",
local_path=model_dir,
)
替代以下代码:
chat = ChatTTS.Chat()
# chat.load_models(compile=False) # Set to True for better performance
chatTTS使用问题
1.链接:git clone https://github.com/2noise/ChatTTS.git
2.遇到'nomalizer'问题,直接pip install nemo_text_processing,pynini,WeTextProcessing,这在linux无问题,windows有问题
解决办法:
在chatTTS里面的core.py:
143行到149行注释掉:
SQL
# if do_text_normalization:
# for i, t in enumerate(text):
# _lang = detect_language(t) if lang is None else lang
# self.init_normalizer(_lang)
# text[i] = self.normalizer[_lang](t)
# if _lang == 'zh':
# text[i] = apply_half2full_map(text[i])
3.huggingface连接问题,在Google colab无问题可连接,但本地出现梯子代理问题,尚未解决
替代解决:
使用以下代码
SQL
from modelscope import snapshot_download
model_dir = snapshot_download('mirror013/ChatTTS')
# # 加载模型
chat = ChatTTS.Chat()
chat.load_models(
source="local",
local_path=model_dir,
)
替代以下代码:
SQL
chat = ChatTTS.Chat()
# chat.load_models(compile=False) # Set to True for better performance
4.torchaudio出现问题
问题如下:
SQL
Traceback (most recent call last):
torchaudio.save("output1.wav", torch.from_numpy(wavs[0]), 24000)
File "D:\Python\Anaconda3_2024_2_1\file\envs\talk\lib\site-packages\torchaudio\_backend\utils.py", line 312, in save
backend = dispatcher(uri, format, backend)
File "D:\Python\Anaconda3_2024_2_1\file\envs\talk\lib\site-packages\torchaudio\_backend\utils.py", line 222, in dispatcher
raise RuntimeError(f"Couldn't find appropriate backend to handle uri {uri} and format {format}.")
RuntimeError: Couldn't find appropriate backend to handle uri output1.wav and format None.
解决办法:
SQL
pip install soundfile
5.webui的使用gradio进行公网链接生成时
设置share=True即可
SQL
import gradio as gr
def greet(name):
return f"Hello {name}!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch(share=True)
如果生成公网链接报错如下:
SQL
INFO:httpx:HTTP Request: GET https://api.gradio.app/v2/tunnel-request "HTTP/1.1 200 OK"
Could not create share link. Missing file: D:\Python\Anaconda3_2024_2_1\file\envs\talk\lib\site-packages\gradio\frpc_windows_amd64_v0.2.
Please check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps:
1. Download this file: https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_windows_amd64.exe
2. Rename the downloaded file to: frpc_windows_amd64_v0.2
3. Move the file to this location: D:\Python\Anaconda3_2024_2_1\file\envs\talk\lib\site-packages\gradio
解决办法:
SQL
点开下载链接:https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_windows_amd64.exe
下载到自创anaconda的环境里的lib\site-packages\gradio下
改名成frpc_windows_amd64_v0.2(注意改名时连exe后缀名也去掉)