mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-04-05 19:41:56 +08:00
parent
afbcf4007a
commit
8dd7cfab93
@ -1,6 +1,6 @@
|
||||
from copy import deepcopy
|
||||
import math
|
||||
import os, sys
|
||||
import os, sys, gc
|
||||
import random
|
||||
import traceback
|
||||
|
||||
@ -869,7 +869,8 @@ class TTS:
|
||||
self.empty_cache()
|
||||
|
||||
def empty_cache(self):
|
||||
try:
|
||||
try:
|
||||
gc.collect() # 触发gc的垃圾回收。避免内存一直增长。
|
||||
if "cuda" in str(self.configs.device):
|
||||
torch.cuda.empty_cache()
|
||||
elif str(self.configs.device) == "mps":
|
||||
@ -939,4 +940,4 @@ def speed_change(input_audio:np.ndarray, speed:float, sr:int):
|
||||
# 将管道输出解码为 NumPy 数组
|
||||
processed_audio = np.frombuffer(out, np.int16)
|
||||
|
||||
return processed_audio
|
||||
return processed_audio
|
||||
|
Loading…
x
Reference in New Issue
Block a user