diff --git a/GPT_SoVITS/VoiceSave/__init__.py b/GPT_SoVITS/VoiceSave/__init__.py index 4e175d51..621a7293 100644 --- a/GPT_SoVITS/VoiceSave/__init__.py +++ b/GPT_SoVITS/VoiceSave/__init__.py @@ -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) - \ No newline at end of file + +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 \ No newline at end of file