Spaces:
Runtime error
Runtime error
marigold334
commited on
Commit
β’
7d29dc7
1
Parent(s):
45fbb93
Update app.py
Browse files
app.py
CHANGED
@@ -6,13 +6,18 @@ from datautils import *
|
|
6 |
from model import Generator as Glow_model
|
7 |
from Hmodel import Generator as GAN_model
|
8 |
|
9 |
-
|
10 |
-
|
|
|
|
|
11 |
|
12 |
class TTS:
|
13 |
def __init__(self, model_variant):
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
16 |
if model_variant == 'μμ':
|
17 |
name = '1038_eunsik_01'
|
18 |
last_chpt1 = './log/1038_eunsik_01/Glow_TTS_00289602.pt'
|
@@ -77,10 +82,7 @@ def generate_voice(input_text):
|
|
77 |
st.caption("Generated Voice")
|
78 |
|
79 |
|
80 |
-
|
81 |
-
page_title = "μμ Team Demo",
|
82 |
-
page_icon = "π",
|
83 |
-
)
|
84 |
|
85 |
init_session_state()
|
86 |
|
|
|
6 |
from model import Generator as Glow_model
|
7 |
from Hmodel import Generator as GAN_model
|
8 |
|
9 |
+
st.set_page_config(
|
10 |
+
page_title = "μμ Team Demo",
|
11 |
+
page_icon = "π",
|
12 |
+
)
|
13 |
|
14 |
class TTS:
|
15 |
def __init__(self, model_variant):
|
16 |
+
global device
|
17 |
+
device = torch.device('cuda:0') if torch.cuda.is_available() else 'cpu'
|
18 |
+
torch.cuda.manual_seed(1234) if torch.cuda.is_available() else None
|
19 |
+
self.flowgenerator = Glow_model(n_vocab = 70, h_c= 192, f_c = 768, f_c_dp = 256, out_c = 80, k_s = 3, k_s_dec = 5, heads=2, layers_enc = 6).to(device)
|
20 |
+
self.voicegenerator = GAN_model().to(device)
|
21 |
if model_variant == 'μμ':
|
22 |
name = '1038_eunsik_01'
|
23 |
last_chpt1 = './log/1038_eunsik_01/Glow_TTS_00289602.pt'
|
|
|
82 |
st.caption("Generated Voice")
|
83 |
|
84 |
|
85 |
+
|
|
|
|
|
|
|
86 |
|
87 |
init_session_state()
|
88 |
|