diff --git a/infer.py b/infer.py index 441e52c..9340ae5 100644 --- a/infer.py +++ b/infer.py @@ -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 diff --git a/oldVersion/V101/__init__.py b/oldVersion/V101/__init__.py index ddec3b1..cffbed1 100644 --- a/oldVersion/V101/__init__.py +++ b/oldVersion/V101/__init__.py @@ -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