Refactor: when pyopenjtalk_worker is called without initialization, continue processing without a worker

When using style-bert-vits2 as a library, the requirement to be able to launch it in multiple processes may not be necessary. Also, if the library is embedded and exe-ed using PyInstaller or similar, it is difficult to make pyopenjtalk_worker run in a separate process.
Therefore, we changed it so that the worker is used only when it is explicitly initialized.
This commit is contained in:
tsukumi
2024-03-10 03:04:27 +00:00
parent a79b1910fb
commit b7d7c78203
4 changed files with 45 additions and 25 deletions

View File

@@ -28,7 +28,7 @@ from style_bert_vits2.tts_model import ModelHolder
# pyopenjtalk_worker を起動
## pyopenjtalk_worker は TCP ソケットサーバーのため、ここで起動する
pyopenjtalk.initialize()
pyopenjtalk.initialize_worker()
# 事前に BERT モデル/トークナイザーをロードしておく
## ここでロードしなくても必要になった際に自動ロードされるが、時間がかかるため事前にロードしておいた方が体験が良い