Skip to content

Commit

Permalink
fix vocab file take from the project
Browse files Browse the repository at this point in the history
  • Loading branch information
lpscr committed Oct 28, 2024
1 parent ec3c35b commit 2dddb10
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/f5_tts/train/finetune_gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ def get_random_sample_infer(project_name):
)


def infer(file_checkpoint, exp_name, ref_text, ref_audio, gen_text, nfe_step, use_ema):
def infer(project, file_checkpoint, exp_name, ref_text, ref_audio, gen_text, nfe_step, use_ema):
global last_checkpoint, last_device, tts_api, last_ema

if not os.path.isfile(file_checkpoint):
Expand All @@ -1182,7 +1182,11 @@ def infer(file_checkpoint, exp_name, ref_text, ref_audio, gen_text, nfe_step, us
if last_ema != use_ema:
last_ema = use_ema

tts_api = F5TTS(model_type=exp_name, ckpt_file=file_checkpoint, device=device_test, use_ema=use_ema)
vocab_file = os.path.join(path_data, project, "vocab.txt")

tts_api = F5TTS(
model_type=exp_name, ckpt_file=file_checkpoint, vocab_file=vocab_file, device=device_test, use_ema=use_ema
)

print("update >> ", device_test, file_checkpoint, use_ema)

Expand Down Expand Up @@ -1630,7 +1634,7 @@ def setup_load_settings():

check_button_infer.click(
fn=infer,
inputs=[cm_checkpoint, exp_name, ref_text, ref_audio, gen_text, nfe_step, ch_use_ema],
inputs=[cm_project, cm_checkpoint, exp_name, ref_text, ref_audio, gen_text, nfe_step, ch_use_ema],
outputs=[gen_audio, txt_info_gpu],
)

Expand Down

0 comments on commit 2dddb10

Please sign in to comment.