Skip to content

Commit

Permalink
fix tts_api after clear in memory (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpscr authored Oct 22, 2024
1 parent 608e224 commit 32c3ee7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions finetune_gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def start_training(
del tts_api
gc.collect()
torch.cuda.empty_cache()
tts_api = None

path_project = os.path.join(path_data, dataset_name + "_pinyin")

Expand Down Expand Up @@ -698,7 +699,7 @@ def get_random_sample_infer(project_name):
)


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

if not os.path.isfile(file_checkpoint):
Expand Down Expand Up @@ -917,7 +918,7 @@ def infer(project_name, file_checkpoint, exp_name, ref_text, ref_audio, gen_text

check_button_infer.click(
fn=infer,
inputs=[project_name, file_checkpoint_pt, exp_name, ref_text, ref_audio, gen_text, nfe_step],
inputs=[file_checkpoint_pt, exp_name, ref_text, ref_audio, gen_text, nfe_step],
outputs=[gen_audio],
)

Expand Down

0 comments on commit 32c3ee7

Please sign in to comment.