部署ChatTTS出现tn包和nemo_text_processing的问题总结
1. 启动时候安装出现的问题
sql
WARNING:ChatTTS.core:Package nemo_text_processing not found! Run:
conda install -c conda-forge pynini=2.1.5 && pip install nemo_text_processing
Traceback (most recent call last): File "D:\projectAll\github\ChatTTS-main\dome.py",
line 12, in <module> wavs = chat.infer(texts, )
File "D:\projectAll\github\ChatTTS-main\ChatTTS\core.py", line 146,
in infer self.init_normalizer(_lang) File
"D:\projectAll\github\ChatTTS-main\ChatTTS\core.py",
line 199, in init_normalizer
self.normalizer[lang] = partial(Normalizer(input_case='cased', lang=lang).normalize,
verbose=False, punct_post_process=True) ^^^^^^^^^^ UnboundLocalError:
cannot access local variable 'Normalizer' where it is not associated with a value
会提醒没有安装:conda install -c conda-forge pynini=2.1.5 && pip install nemo_text_processing
安装nemo_text_processing报错:
vbnet
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
Traceback (most recent call last):
File "D:\venv\chat\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "D:\venv\chat\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\venv\chat\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jxb99\AppData\Local\Temp\pip-build-env-cfbw2jgs\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jxb99\AppData\Local\Temp\pip-build-env-cfbw2jgs\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "C:\Users\jxb99\AppData\Local\Temp\pip-build-env-cfbw2jgs\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
super().run_setup(setup_script=setup_script)
File "C:\Users\jxb99\AppData\Local\Temp\pip-build-env-cfbw2jgs\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 22, in <module>
ModuleNotFoundError: No module named 'Cython'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
2. 解决方案:
torchaudio内存有点大2.4g
pip
conda install -c conda-forge pynini=2.1.5
pip uninstall torchaudio
pip install torchaudio -f https://download.pytorch.org/whl/torch_stable.html
pip install nemo_text_processing
- core.py文件中会有一个文件找不到:
javascript
from tn.chinese.normalizer import Normalizer
4.解决tn包的问题:
arduino
# install
pip install WeTextProcessing