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
5.99k stars 688 forks source link

macOS 生成的时候报错 Initializing libomp.dylib, but found libiomp5.dylib already initialized #21

Closed cdk8s-zelda closed 4 months ago

cdk8s-zelda commented 4 months ago

先感谢作者提供支持

系统环境

报错截图

iShot_2024-05-31_21 36 41
2024-05-31 21:33:36,503 - modelscope - INFO - PyTorch version 2.2.2 Found.
2024-05-31 21:33:36,503 - modelscope - INFO - Loading ast index from /Users/meek/.cache/modelscope/ast_indexer
2024-05-31 21:33:36,539 - modelscope - INFO - Loading done! Current index file version is 1.14.0, with md5 54c70b20f857389f69e0735c6ef5281c and a total number of 976 components indexed
INFO:ChatTTS.core:Load from local: /Users/meek/my-software/chatTTS-ui/models/pzc163/chatTTS
WARNING:ChatTTS.utils.gpu_utils:No GPU found, use CPU instead
INFO:ChatTTS.core:use cpu
INFO:ChatTTS.core:vocos loaded.
INFO:ChatTTS.core:dvae loaded.
INFO:ChatTTS.core:gpt loaded.
INFO:ChatTTS.core:decoder loaded.
INFO:ChatTTS.core:tokenizer loaded.
INFO:ChatTTS.core:All initialized.
启动:['127.0.0.1', '9966']
  0%|                                                                                                                                                                                    | 0/384 [00:00<?, ?it/s]OMP: Error #15: Initializing libomp.dylib, but found libiomp5.dylib already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/
[1]    7798 abort      python3 app.py
/Users/meek/opt/anaconda3/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d

尝试过一些措施,但是都没有效果

export KMP_DUPLICATE_LIB_OK=FALSE

export KMP_DUPLICATE_LIB_OK=TRUE

export OMP_DYNAMIC=FALSE

DYLD_INSERT_LIBRARIES=/usr/local/Cellar/libomp/18.1.6/lib/libomp.dylib python3 app.py
jianchang512 commented 4 months ago

在app.py的 import os 的下一行,添加代码

os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'

试试

cdk8s-zelda commented 4 months ago

在app.py的 import os 的下一行,添加代码

os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'

试试

2024-05-31 22:01:36,693 - modelscope - INFO - PyTorch version 2.2.2 Found.
2024-05-31 22:01:36,693 - modelscope - INFO - Loading ast index from /Users/meek/.cache/modelscope/ast_indexer
2024-05-31 22:01:36,728 - modelscope - INFO - Loading done! Current index file version is 1.14.0, with md5 54c70b20f857389f69e0735c6ef5281c and a total number of 976 components indexed
INFO:ChatTTS.core:Load from local: /Users/meek/my-software/chatTTS-ui/models/pzc163/chatTTS
WARNING:ChatTTS.utils.gpu_utils:No GPU found, use CPU instead
INFO:ChatTTS.core:use cpu
INFO:ChatTTS.core:vocos loaded.
INFO:ChatTTS.core:dvae loaded.
INFO:ChatTTS.core:gpt loaded.
INFO:ChatTTS.core:decoder loaded.
INFO:ChatTTS.core:tokenizer loaded.
INFO:ChatTTS.core:All initialized.
启动:['127.0.0.1', '9966']
  0%|
jianchang512 commented 4 months ago

app.py中

chat.load_models(source="local",local_path=CHATTTS_DIR)

改为

chat.load_models(source="local",local_path=CHATTTS_DIR,compile=False)

试试

cdk8s-zelda commented 4 months ago

app.py中

chat.load_models(source="local",local_path=CHATTTS_DIR)

改为

chat.load_models(source="local",local_path=CHATTTS_DIR,compile=False)

试试