1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-05 01:10:22 +08:00

fix(fairseq): hubert load model error

This commit is contained in:
源文雨
2026-04-18 19:04:13 +08:00
parent 8ded36e9e1
commit f9ae0b5d32
12 changed files with 101 additions and 151 deletions

19
web.py
View File

@@ -88,23 +88,24 @@ index_paths = [""]
def lookup_names(weight_root):
global names
names = []
for name in os.listdir(weight_root):
if name.endswith(".pth"):
names.append(name)
return names
def lookup_indices(index_root):
global index_paths
index_paths = []
for root, _, files in os.walk(index_root, topdown=False):
for name in files:
if name.endswith(".index") and "trained" not in name:
index_paths.append(str(pathlib.Path(root, name)))
return index_paths
lookup_names(weight_root)
lookup_indices(index_root)
lookup_indices(outside_index_root)
names = [""] + lookup_names(weight_root)
index_paths = [""] + lookup_indices(index_root) + lookup_indices(outside_index_root)
uvr5_names = []
for name in os.listdir(weight_uvr5_root):
if name.endswith(".pth") or "onnx" in name:
@@ -112,12 +113,8 @@ for name in os.listdir(weight_uvr5_root):
def change_choices():
global index_paths, names
names = [""]
lookup_names(weight_root)
index_paths = [""]
lookup_indices(index_root)
lookup_indices(outside_index_root)
names = [""] + lookup_names(weight_root)
index_paths = [""] + lookup_indices(index_root) + lookup_indices(outside_index_root)
return {"choices": sorted(names), "__type__": "update"}, {
"choices": sorted(index_paths),
"__type__": "update",