Spaces:
Running
on
Zero
Running
on
Zero
initialize model on GPU
Browse files
app.py
CHANGED
@@ -6,6 +6,19 @@ import torch
|
|
6 |
from synthesize import synthesize
|
7 |
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
@spaces.GPU
|
10 |
def text_to_speech(text, speaker_id, cfg_scale, num_sampling_steps):
|
11 |
audio, sample_rate = synthesize(
|
|
|
6 |
from synthesize import synthesize
|
7 |
|
8 |
|
9 |
+
# initialize model
|
10 |
+
audio, sample_rate = synthesize(
|
11 |
+
text="Hello",
|
12 |
+
duration_model_config="./train_duration_dit_s.yaml",
|
13 |
+
acoustic_model_config="./train_acoustic_dit_b.yaml",
|
14 |
+
duration_model_checkpoint="./duration_model_0120000.pt",
|
15 |
+
acoustic_model_checkpoint="./acoustic_model_0140000.pt",
|
16 |
+
speaker_id=0,
|
17 |
+
cfg_scale=4.0,
|
18 |
+
num_sampling_steps=100,
|
19 |
+
)
|
20 |
+
|
21 |
+
|
22 |
@spaces.GPU
|
23 |
def text_to_speech(text, speaker_id, cfg_scale, num_sampling_steps):
|
24 |
audio, sample_rate = synthesize(
|