Spaces:
Running
Running
add
Browse files
app.py
CHANGED
@@ -54,17 +54,20 @@ for folder_name in folder_names:
|
|
54 |
models_info[speaker]["config"] = f"{config_path}/config.json"
|
55 |
if os.path.exists(f"{models_path}/feature_and_index.pkl"):
|
56 |
models_info[speaker]["cluster"] = f"{models_path}/feature_and_index.pkl"
|
|
|
57 |
elif os.path.exists(f"{models_path}/kmeans_10000.pt"):
|
58 |
models_info[speaker]["cluster"] = f"{models_path}/kmeans_10000.pt"
|
|
|
59 |
else:
|
60 |
models_info[speaker]["cluster"] = "logs/44k/kmeans_10000.pt"
|
|
|
61 |
speakers = list(models_info.keys())
|
62 |
|
63 |
def load(speaker):
|
64 |
global sid
|
65 |
global model
|
66 |
sid = speaker
|
67 |
-
model = Svc(models_info[speaker]["model"], models_info[speaker]["config"], cluster_model_path=models_info[speaker]["cluster"])
|
68 |
return "加载成功"
|
69 |
load(speakers[0])
|
70 |
|
|
|
54 |
models_info[speaker]["config"] = f"{config_path}/config.json"
|
55 |
if os.path.exists(f"{models_path}/feature_and_index.pkl"):
|
56 |
models_info[speaker]["cluster"] = f"{models_path}/feature_and_index.pkl"
|
57 |
+
models_info[speaker]["feature_retrieval"] = True
|
58 |
elif os.path.exists(f"{models_path}/kmeans_10000.pt"):
|
59 |
models_info[speaker]["cluster"] = f"{models_path}/kmeans_10000.pt"
|
60 |
+
models_info[speaker]["feature_retrieval"] = False
|
61 |
else:
|
62 |
models_info[speaker]["cluster"] = "logs/44k/kmeans_10000.pt"
|
63 |
+
models_info[speaker]["feature_retrieval"] = False
|
64 |
speakers = list(models_info.keys())
|
65 |
|
66 |
def load(speaker):
|
67 |
global sid
|
68 |
global model
|
69 |
sid = speaker
|
70 |
+
model = Svc(models_info[speaker]["model"], models_info[speaker]["config"], cluster_model_path=models_info[speaker]["cluster"], feature_retrieval=models_info[speaker]["feature_retrieval"])
|
71 |
return "加载成功"
|
72 |
load(speakers[0])
|
73 |
|