Spaces:
Sleeping
Sleeping
zhzluke96
commited on
Commit
•
d9b74ff
1
Parent(s):
c3d1bca
update
Browse files- modules/models.py +2 -3
modules/models.py
CHANGED
@@ -7,7 +7,6 @@ from modules.devices import devices
|
|
7 |
import logging
|
8 |
import gc
|
9 |
|
10 |
-
import torch.multiprocessing as mp
|
11 |
|
12 |
logger = logging.getLogger(__name__)
|
13 |
|
@@ -41,14 +40,14 @@ def load_chat_tts_in_thread():
|
|
41 |
def initialize_chat_tts():
|
42 |
with lock:
|
43 |
if chat_tts is None:
|
44 |
-
model_thread =
|
45 |
model_thread.start()
|
46 |
model_thread.join()
|
47 |
|
48 |
|
49 |
def load_chat_tts():
|
50 |
if chat_tts is None:
|
51 |
-
|
52 |
if chat_tts is None:
|
53 |
raise Exception("Failed to load ChatTTS models")
|
54 |
return chat_tts
|
|
|
7 |
import logging
|
8 |
import gc
|
9 |
|
|
|
10 |
|
11 |
logger = logging.getLogger(__name__)
|
12 |
|
|
|
40 |
def initialize_chat_tts():
|
41 |
with lock:
|
42 |
if chat_tts is None:
|
43 |
+
model_thread = threading.Thread(target=load_chat_tts_in_thread)
|
44 |
model_thread.start()
|
45 |
model_thread.join()
|
46 |
|
47 |
|
48 |
def load_chat_tts():
|
49 |
if chat_tts is None:
|
50 |
+
load_chat_tts_in_thread()
|
51 |
if chat_tts is None:
|
52 |
raise Exception("Failed to load ChatTTS models")
|
53 |
return chat_tts
|