Spaces:
Paused
Paused
Sync from GitHub repo
Browse filesThis Space is synced from the GitHub repo: https://github.com/SWivid/F5-TTS. Please submit contributions to the Space there
src/f5_tts/train/finetune_gradio.py
CHANGED
|
@@ -1161,7 +1161,7 @@ def get_random_sample_infer(project_name):
|
|
| 1161 |
)
|
| 1162 |
|
| 1163 |
|
| 1164 |
-
def infer(file_checkpoint, exp_name, ref_text, ref_audio, gen_text, nfe_step, use_ema):
|
| 1165 |
global last_checkpoint, last_device, tts_api, last_ema
|
| 1166 |
|
| 1167 |
if not os.path.isfile(file_checkpoint):
|
|
@@ -1182,7 +1182,11 @@ def infer(file_checkpoint, exp_name, ref_text, ref_audio, gen_text, nfe_step, us
|
|
| 1182 |
if last_ema != use_ema:
|
| 1183 |
last_ema = use_ema
|
| 1184 |
|
| 1185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1186 |
|
| 1187 |
print("update >> ", device_test, file_checkpoint, use_ema)
|
| 1188 |
|
|
@@ -1630,7 +1634,7 @@ SOS : check the use_ema setting (True or False) for your model to see what works
|
|
| 1630 |
|
| 1631 |
check_button_infer.click(
|
| 1632 |
fn=infer,
|
| 1633 |
-
inputs=[cm_checkpoint, exp_name, ref_text, ref_audio, gen_text, nfe_step, ch_use_ema],
|
| 1634 |
outputs=[gen_audio, txt_info_gpu],
|
| 1635 |
)
|
| 1636 |
|
|
|
|
| 1161 |
)
|
| 1162 |
|
| 1163 |
|
| 1164 |
+
def infer(project, file_checkpoint, exp_name, ref_text, ref_audio, gen_text, nfe_step, use_ema):
|
| 1165 |
global last_checkpoint, last_device, tts_api, last_ema
|
| 1166 |
|
| 1167 |
if not os.path.isfile(file_checkpoint):
|
|
|
|
| 1182 |
if last_ema != use_ema:
|
| 1183 |
last_ema = use_ema
|
| 1184 |
|
| 1185 |
+
vocab_file = os.path.join(path_data, project, "vocab.txt")
|
| 1186 |
+
|
| 1187 |
+
tts_api = F5TTS(
|
| 1188 |
+
model_type=exp_name, ckpt_file=file_checkpoint, vocab_file=vocab_file, device=device_test, use_ema=use_ema
|
| 1189 |
+
)
|
| 1190 |
|
| 1191 |
print("update >> ", device_test, file_checkpoint, use_ema)
|
| 1192 |
|
|
|
|
| 1634 |
|
| 1635 |
check_button_infer.click(
|
| 1636 |
fn=infer,
|
| 1637 |
+
inputs=[cm_project, cm_checkpoint, exp_name, ref_text, ref_audio, gen_text, nfe_step, ch_use_ema],
|
| 1638 |
outputs=[gen_audio, txt_info_gpu],
|
| 1639 |
)
|
| 1640 |
|