jianchang512 / ChatTTS-ui

一个简单的本地网页界面,使用ChatTTS将文字合成为语音,同时支持对外提供API接口。A simple native web interface that uses ChatTTS to synthesize text into speech, along with support for external API interfaces.
https://pyvideotrans.com
Other
4.98k stars 541 forks source link

0.9版本compile=True报错 #126

Closed fengs2021 closed 6 days ago

fengs2021 commented 2 weeks ago

Starting... 2024-06-11 21:26:01,227 - modelscope - INFO - PyTorch version 2.2.0+cu118 Found. 2024-06-11 21:26:01,229 - modelscope - INFO - Loading ast index from C:\Users\liqih.cache\modelscope\ast_indexer 2024-06-11 21:26:01,488 - modelscope - INFO - Loading done! Current index file version is 1.15.0, with md5 5a2531b9406c49ca9a886a774b34174c and a total number of 980 components indexed INFO:ChatTTS.core:Load from local: F:/ChatTTS/models/pzc163/chatTTS INFO:ChatTTS.core:use cuda:0 INFO:ChatTTS.core:vocos loaded. INFO:ChatTTS.core:dvae loaded. Traceback (most recent call last): File "F:\ChatTTS\app.py", line 64, in chat.load_models(source="local",local_path=CHATTTS_DIR, device=None if device=='default' else device,compile=True if os.getenv('compile','true').lower()!='false' else False) File "F:\ChatTTS\ChatTTS\core.py", line 62, in load_models self._load({k: os.path.join(download_path, v) for k, v in OmegaConf.load(os.path.join(download_path, 'config', 'path.yaml')).items()}, kwargs) File "F:\ChatTTS\ChatTTS\core.py", line 103, in _load gpt.gpt.forward = torch.compile(gpt.gpt.forward, backend='inductor', dynamic=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ChatTTS\venv\Lib\site-packages\torch__init__.py", line 1795, in compile raise RuntimeError("Dynamo is not supported on Python 3.12+") RuntimeError: Dynamo is not supported on Python 3.12+

jianchang512 commented 2 weeks ago

不支持py3.12

报错信息里都说明了不支持3.12

fengs2021 commented 2 weeks ago

3.11也报错Traceback (most recent call last): File "F:\ChatTTS\app.py", line 64, in chat.load_models(source="local",local_path=CHATTTS_DIR, device=None if device=='default' else device,compile=True if os.getenv('compile','true').lower()!='false' else False) File "F:\ChatTTS\ChatTTS\core.py", line 62, in load_models self._load({k: os.path.join(download_path, v) for k, v in OmegaConf.load(os.path.join(download_path, 'config', 'path.yaml')).items()}, kwargs) File "F:\ChatTTS\ChatTTS\core.py", line 103, in _load gpt.gpt.forward = torch.compile(gpt.gpt.forward, backend='inductor', dynamic=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ChatTTS\venv\Lib\site-packages\torch__init__.py", line 1820, in compile return torch._dynamo.optimize(backend=backend, nopython=fullgraph, dynamic=dynamic, disable=disable)(model) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ChatTTS\venv\Lib\site-packages\torch_dynamo\eval_frame.py", line 753, in optimize check_if_dynamo_supported() File "F:\ChatTTS\venv\Lib\site-packages\torch_dynamo\eval_frame.py", line 702, in check_if_dynamo_supported raise RuntimeError("Windows not yet supported for torch.compile") RuntimeError: Windows not yet supported for torch.compile

jianchang512 commented 2 weeks ago
  1. 用 3.10
  2. 如果仍报错,将compile 设为False, True是启用推理优化,不是所有显卡、cuda、torch版本都支持
fengs2021 commented 2 weeks ago

win平台不支持torch.compile