mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-01-20 02:51:09 +00:00
Format code (#1162)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a86806b01a
commit
dace5a6f99
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
now_dir = os.getcwd()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
import librosa
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
import traceback
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
import ffmpeg
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
import librosa
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import traceback
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
import numpy as np
|
||||
@@ -52,8 +53,16 @@ class VC:
|
||||
if not sid:
|
||||
if self.hubert_model is not None: # 考虑到轮询, 需要加个判断看是否 sid 是由有模型切换到无模型的
|
||||
logger.info("Clean model cache")
|
||||
del self.net_g, self.n_spk, self.vc, self.hubert_model, self.tgt_sr # ,cpt
|
||||
self.hubert_model = self.net_g = self.n_spk = self.vc = self.hubert_model = self.tgt_sr = None
|
||||
del (
|
||||
self.net_g,
|
||||
self.n_spk,
|
||||
self.vc,
|
||||
self.hubert_model,
|
||||
self.tgt_sr,
|
||||
) # ,cpt
|
||||
self.hubert_model = (
|
||||
self.net_g
|
||||
) = self.n_spk = self.vc = self.hubert_model = self.tgt_sr = None
|
||||
if torch.cuda.is_available():
|
||||
torch.cuda.empty_cache()
|
||||
###楼下不这么折腾清理不干净
|
||||
|
||||
@@ -2,6 +2,7 @@ import os
|
||||
import sys
|
||||
import traceback
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
from functools import lru_cache
|
||||
@@ -267,9 +268,7 @@ class Pipeline(object):
|
||||
with torch.no_grad():
|
||||
hasp = pitch is not None and pitchf is not None
|
||||
arg = (feats, p_len, pitch, pitchf, sid) if hasp else (feats, p_len, sid)
|
||||
audio1 = (
|
||||
(net_g.infer(*arg)[0][0, 0]).data.cpu().float().numpy()
|
||||
)
|
||||
audio1 = (net_g.infer(*arg)[0][0, 0]).data.cpu().float().numpy()
|
||||
del hasp, arg
|
||||
del feats, p_len, padding_mask
|
||||
if torch.cuda.is_available():
|
||||
|
||||
@@ -2,6 +2,7 @@ import os
|
||||
|
||||
from fairseq import checkpoint_utils
|
||||
|
||||
|
||||
def get_index_path_from_model(sid):
|
||||
return next(
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user