mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-01-20 11:00:23 +00:00
fix: 卸载音色省显存
顺便将所有print换成了统一的logger
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
格式:直接cid为自带的index位;aid放不下了,通过字典来查,反正就5w个
|
||||
"""
|
||||
import os
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
import faiss
|
||||
import numpy as np
|
||||
@@ -13,19 +15,19 @@ for name in sorted(list(os.listdir(inp_root))):
|
||||
phone = np.load("%s/%s" % (inp_root, name))
|
||||
npys.append(phone)
|
||||
big_npy = np.concatenate(npys, 0)
|
||||
print(big_npy.shape) # (6196072, 192)#fp32#4.43G
|
||||
logger.debug(big_npy.shape) # (6196072, 192)#fp32#4.43G
|
||||
np.save("infer/big_src_feature_mi.npy", big_npy)
|
||||
|
||||
##################train+add
|
||||
# big_npy=np.load("/bili-coeus/jupyter/jupyterhub-liujing04/vits_ch/inference_f0/big_src_feature_mi.npy")
|
||||
print(big_npy.shape)
|
||||
logger.debug(big_npy.shape)
|
||||
index = faiss.index_factory(256, "IVF512,Flat") # mi
|
||||
print("Training...")
|
||||
logger.info("Training...")
|
||||
index_ivf = faiss.extract_index_ivf(index) #
|
||||
index_ivf.nprobe = 9
|
||||
index.train(big_npy)
|
||||
faiss.write_index(index, "infer/trained_IVF512_Flat_mi_baseline_src_feat.index")
|
||||
print("Adding...")
|
||||
logger.info("Adding...")
|
||||
index.add(big_npy)
|
||||
faiss.write_index(index, "infer/added_IVF512_Flat_mi_baseline_src_feat.index")
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user