Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ import numpy as np
|
|
9 |
|
10 |
import ChatTTS
|
11 |
|
12 |
-
|
13 |
from OpenVoice.api import ToneColorConverter
|
14 |
import soundfile
|
15 |
|
@@ -68,14 +68,11 @@ def chat_tts(text, temperature, top_P, top_K, audio_seed_input, text_seed_input,
|
|
68 |
return text_data
|
69 |
|
70 |
# OpenVoice Clone
|
71 |
-
|
72 |
device = 'cuda:0'
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
tone_color_converter = ToneColorConverter(f'{ckpt_converter_en}/config.json', device=device)
|
77 |
-
tone_color_converter.load_ckpt(f'{ckpt_converter_en}/checkpoint.pth')
|
78 |
-
|
79 |
|
80 |
def generate_audio(text, audio_ref, temperature, top_P, top_K, audio_seed_input, text_seed_input, refine_text_flag, refine_text_input):
|
81 |
save_path = "output.wav"
|
|
|
9 |
|
10 |
import ChatTTS
|
11 |
|
12 |
+
from OpenVoice import se_extractor
|
13 |
from OpenVoice.api import ToneColorConverter
|
14 |
import soundfile
|
15 |
|
|
|
68 |
return text_data
|
69 |
|
70 |
# OpenVoice Clone
|
71 |
+
ckpt_converter = 'checkpoints/converter'
|
72 |
device = 'cuda:0'
|
73 |
|
74 |
+
tone_color_converter = ToneColorConverter(f'{ckpt_converter}/config.json', device=device)
|
75 |
+
tone_color_converter.load_ckpt(f'{ckpt_converter}/checkpoint.pth')
|
|
|
|
|
|
|
76 |
|
77 |
def generate_audio(text, audio_ref, temperature, top_P, top_K, audio_seed_input, text_seed_input, refine_text_flag, refine_text_input):
|
78 |
save_path = "output.wav"
|