Skip to content

Commit

Permalink
small updates and to or in model load
Browse files Browse the repository at this point in the history
  • Loading branch information
lpscr committed Oct 21, 2024
1 parent 20f823d commit 7920e52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion finetune_gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,14 +709,16 @@ def infer(project_name, file_checkpoint, exp_name, ref_text, ref_audio, gen_text
else:
device_test = None

if last_checkpoint != file_checkpoint and last_device != device_test:
if last_checkpoint != file_checkpoint or last_device != device_test:
if last_checkpoint != file_checkpoint:
last_checkpoint = file_checkpoint
if last_device != device_test:
last_device = device_test

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

print("update", device_test, file_checkpoint)

with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as f:
tts_api.infer(gen_text=gen_text, ref_text=ref_text, ref_file=ref_audio, nfe_step=nfe_step, file_wave=f.name)
return f.name
Expand Down

0 comments on commit 7920e52

Please sign in to comment.