barreloflube
commited on
Commit
•
7925940
1
Parent(s):
89b8fd1
Refactor gen_audio function to use CosyVoice TTS instead of SFT
Browse files- config.py +1 -1
- tabs/audios/events.py +1 -1
config.py
CHANGED
@@ -8,7 +8,7 @@ import torch
|
|
8 |
|
9 |
# Audios
|
10 |
os.environ['PYTHONPATH'] = f'{os.path.dirname(__file__)}/modules/CosyVoice/third_party/Matcha-TTS:{os.environ.get("PYTHONPATH", "")}' # add tabs/audios/modules/CosyVoice/third_party/Matcha-TTS to PYTHONPATH
|
11 |
-
|
12 |
|
13 |
css = """
|
14 |
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');
|
|
|
8 |
|
9 |
# Audios
|
10 |
os.environ['PYTHONPATH'] = f'{os.path.dirname(__file__)}/modules/CosyVoice/third_party/Matcha-TTS:{os.environ.get("PYTHONPATH", "")}' # add tabs/audios/modules/CosyVoice/third_party/Matcha-TTS to PYTHONPATH
|
11 |
+
os.environ['PYTHONPATH'] = f'{os.path.dirname(__file__)}/modules/CosyVoice:{os.environ.get("PYTHONPATH", "")}' # add tabs/audios/modules/CosyVoice to PYTHONPATH
|
12 |
|
13 |
css = """
|
14 |
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');
|
tabs/audios/events.py
CHANGED
@@ -155,7 +155,7 @@ def gen_audio(text, mode, sft_speaker = None, speaker_audio = None, voice_instru
|
|
155 |
if not sft_speaker:
|
156 |
raise gr.Error('Please select a speaker')
|
157 |
|
158 |
-
for i, j in enumerate(
|
159 |
tts_text=text,
|
160 |
spk_id=sft_speaker,
|
161 |
)):
|
|
|
155 |
if not sft_speaker:
|
156 |
raise gr.Error('Please select a speaker')
|
157 |
|
158 |
+
for i, j in enumerate(cv_sft.inference_sft(
|
159 |
tts_text=text,
|
160 |
spk_id=sft_speaker,
|
161 |
)):
|