@@ -1,6 +1,6 @@
|
||||
from copy import deepcopy
|
||||
import math
|
||||
import os, sys
|
||||
import os, sys, gc
|
||||
import random
|
||||
import traceback
|
||||
|
||||
@@ -870,6 +870,7 @@ class TTS:
|
||||
|
||||
def empty_cache(self):
|
||||
try:
|
||||
gc.collect() # 触发gc的垃圾回收。避免内存一直增长。
|
||||
if "cuda" in str(self.configs.device):
|
||||
torch.cuda.empty_cache()
|
||||
elif str(self.configs.device) == "mps":
|
||||
|
||||
Reference in New Issue
Block a user