Skip to content

Commit

Permalink
fix memory leak in streamlit app
Browse files Browse the repository at this point in the history
  • Loading branch information
manmay-nakhashi committed Jul 29, 2023
1 parent ec420c1 commit 6b8caa8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tortoise/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ def run_and_save_tts(
#
if not isinstance(gen, list):
gen = [gen]
gen = [g.squeeze(0).cpu() for g in gen]
audio_ = [g.squeeze(0).cpu() for g in gen]
fps = []
for i, g in enumerate(gen):
for i, g in enumerate(audio_):
fps.append(output_dir / f"{i}.wav")
save_gen_with_voicefix(g, fps[-1], squeeze=False, voicefixer=voicefixer)
# torchaudio.save(output_dir/f'{i}.wav', g, 24000)
return fps if return_filepaths else gen
return fps if return_filepaths else audio_


def infer_on_texts(
Expand Down

0 comments on commit 6b8caa8

Please sign in to comment.