Spaces:
Running
Running
Commit
·
0216bfe
1
Parent(s):
e90071b
update
Browse files- app_locally.py +6 -2
app_locally.py
CHANGED
@@ -6,12 +6,16 @@ import gradio as gr
|
|
6 |
from melo.api import TTS
|
7 |
|
8 |
# Init EN/ZH baseTTS and ToneConvertor
|
9 |
-
from
|
10 |
-
from
|
11 |
import devicetorch
|
12 |
|
13 |
device = devicetorch.get(torch)
|
14 |
|
|
|
|
|
|
|
|
|
15 |
def predict(prompt, style, audio_file_pth, mic_file_path, use_mic, language):
|
16 |
# initialize a empty info
|
17 |
text_hint = ''
|
|
|
6 |
from melo.api import TTS
|
7 |
|
8 |
# Init EN/ZH baseTTS and ToneConvertor
|
9 |
+
from openVoice import se_extractor
|
10 |
+
from openVoice.api import ToneColorConverter
|
11 |
import devicetorch
|
12 |
|
13 |
device = devicetorch.get(torch)
|
14 |
|
15 |
+
ckpt_converter = 'checkpoints/converter'
|
16 |
+
tone_color_converter = ToneColorConverter(f'{ckpt_converter}/config.json', device=device)
|
17 |
+
tone_color_converter.load_ckpt(f'{ckpt_converter}/checkpoint.pth')
|
18 |
+
|
19 |
def predict(prompt, style, audio_file_pth, mic_file_path, use_mic, language):
|
20 |
# initialize a empty info
|
21 |
text_hint = ''
|