mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2026-04-29 21:00:42 +08:00
feat:向 VoiceSave 模块中添加 find_func
This commit is contained in:
parent
46ae12bf17
commit
5c03499fcf
@ -114,6 +114,7 @@ def save_tensor(path: str,
|
||||
else:
|
||||
files = file_names
|
||||
|
||||
print(f"length of tensors: {len(tensors)}, length of files: {len(files)}")
|
||||
if len(tensors) != len(files):
|
||||
raise ValueError("The number of tensors and files must be the same.")
|
||||
np_arrays = []
|
||||
@ -160,4 +161,18 @@ def add_tensor(add:list[torch.Tensor],
|
||||
tensors = load_tensor(path,name,find_func,MySet=MySet)
|
||||
tensors.extend(add)
|
||||
save_tensor(path,tensors,name,MySet=MySet,file_names=file_names,**info_save)
|
||||
|
||||
|
||||
def __find_func__(zf,il):
|
||||
f = zf.get_file_path("voice.json")
|
||||
info = il.load_info(f)
|
||||
if info is None:
|
||||
return None
|
||||
list_names = info["access_list"]
|
||||
ret = []
|
||||
for name in list_names:
|
||||
try:
|
||||
a = zf.get_file_path(name)
|
||||
ret.append(a)
|
||||
except FileNotFoundError:
|
||||
continue
|
||||
return ret
|
||||
Loading…
x
Reference in New Issue
Block a user