mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-07 19:40:44 +08:00
Fix memory doesn't unload on mps device (#2035)
* Solving the cache not being cleared in mps * Fix protect not to be dict
This commit is contained in:
@@ -291,6 +291,8 @@ class Pipeline(object):
|
||||
del feats, p_len, padding_mask
|
||||
if torch.cuda.is_available():
|
||||
torch.cuda.empty_cache()
|
||||
elif torch.backends.mps.is_available():
|
||||
torch.mps.empty_cache()
|
||||
t2 = ttime()
|
||||
times[0] += t1 - t0
|
||||
times[2] += t2 - t1
|
||||
@@ -472,4 +474,6 @@ class Pipeline(object):
|
||||
del pitch, pitchf, sid
|
||||
if torch.cuda.is_available():
|
||||
torch.cuda.empty_cache()
|
||||
elif torch.backends.mps.is_available():
|
||||
torch.mps.empty_cache()
|
||||
return audio_opt
|
||||
|
||||
Reference in New Issue
Block a user