Skip to content

Commit

Permalink
Fix: Add missing torch.cuda.empty_cache() (fishaudio#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
Artrajz authored Nov 8, 2023
1 parent 6a77c8b commit 6e66fec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,6 @@ def infer(
.numpy()
)
del x_tst, tones, lang_ids, bert, x_tst_lengths, speakers, ja_bert, en_bert
if torch.cuda.is_available():
torch.cuda.empty_cache()
return audio
2 changes: 2 additions & 0 deletions oldVersion/V101/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,6 @@ def infer(
.numpy()
)
del x_tst, tones, lang_ids, bert, x_tst_lengths, speakers
if torch.cuda.is_available():
torch.cuda.empty_cache()
return audio

0 comments on commit 6e66fec

Please sign in to comment.