zhzluke96 commited on
Commit ·
d9b74ff
1
Parent(s): c3d1bca
update
Browse files6 unmodified lines7891011121327 unmodified lines41424344454647484950515253546 unmodified linesimport loggingimport gcimport torch.multiprocessing as mplogger = logging.getLogger(__name__)27 unmodified linesdef initialize_chat_tts():with lock:if chat_tts is None:model_thread = mp.Process(target=load_chat_tts_in_thread)model_thread.start()model_thread.join()def load_chat_tts():if chat_tts is None:initialize_chat_tts()if chat_tts is None:raise Exception("Failed to load ChatTTS models")return chat_tts6 unmodified lines78910111227 unmodified lines40414243444546474849505152536 unmodified linesimport loggingimport gclogger = logging.getLogger(__name__)27 unmodified linesdef initialize_chat_tts():with lock:if chat_tts is None:model_thread = threading.Thread(target=load_chat_tts_in_thread)model_thread.start()model_thread.join()def load_chat_tts():if chat_tts is None:load_chat_tts_in_thread()if chat_tts is None:raise Exception("Failed to load ChatTTS models")return chat_tts
modules/models.py+2-3