mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-01-19 21:00:11 +08:00
commit
34fa3be51e
27
infer-web.py
27
infer-web.py
@ -148,19 +148,20 @@ def get_vc(sid):
|
|||||||
global n_spk,tgt_sr,net_g,vc,cpt
|
global n_spk,tgt_sr,net_g,vc,cpt
|
||||||
if(sid==[]):
|
if(sid==[]):
|
||||||
global hubert_model
|
global hubert_model
|
||||||
print("clean_empty_cache")
|
if (hubert_model != None): # 考虑到轮询,需要加个判断看是否 sid 是由有模型切换到无模型的
|
||||||
del n_spk, vc, hubert_model,tgt_sr#,cpt
|
print("clean_empty_cache")
|
||||||
hubert_model = net_g=n_spk=vc=hubert_model=tgt_sr=None
|
del net_g, n_spk, vc, hubert_model,tgt_sr#,cpt
|
||||||
torch.cuda.empty_cache()
|
hubert_model = net_g=n_spk=vc=hubert_model=tgt_sr=None
|
||||||
###楼下不这么折腾清理不干净
|
torch.cuda.empty_cache()
|
||||||
if_f0 = cpt.get("f0", 1)
|
###楼下不这么折腾清理不干净
|
||||||
if (if_f0 == 1):
|
if_f0 = cpt.get("f0", 1)
|
||||||
net_g = SynthesizerTrnMs256NSFsid(*cpt["config"], is_half=is_half)
|
if (if_f0 == 1):
|
||||||
else:
|
net_g = SynthesizerTrnMs256NSFsid(*cpt["config"], is_half=is_half)
|
||||||
net_g = SynthesizerTrnMs256NSFsid_nono(*cpt["config"])
|
else:
|
||||||
del net_g,cpt
|
net_g = SynthesizerTrnMs256NSFsid_nono(*cpt["config"])
|
||||||
torch.cuda.empty_cache()
|
del net_g,cpt
|
||||||
cpt=None
|
torch.cuda.empty_cache()
|
||||||
|
cpt=None
|
||||||
return {"visible": False, "__type__": "update"}
|
return {"visible": False, "__type__": "update"}
|
||||||
person = "%s/%s" % (weight_root, sid)
|
person = "%s/%s" % (weight_root, sid)
|
||||||
print("loading %s"%person)
|
print("loading %s"%person)
|
||||||
|
Loading…
Reference in New Issue
Block a user