Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -176,7 +176,7 @@ def infer(name, path, index, vc_input, vc_upload, tts_text, tts_voice, f0_up_key
|
|
| 176 |
return info, (None, None)
|
| 177 |
def load_model():
|
| 178 |
categories = []
|
| 179 |
-
with open("weights/folder_info.json", "r", encoding="utf-8") as f:
|
| 180 |
folder_info = json.load(f)
|
| 181 |
for category_name, category_info in folder_info.items():
|
| 182 |
if not category_info['enable']:
|
|
@@ -185,14 +185,14 @@ def load_model():
|
|
| 185 |
category_folder = category_info['folder_path']
|
| 186 |
models = []
|
| 187 |
print(f"Creating category {category_title}...")
|
| 188 |
-
with open(f"weights/{category_folder}/model_info.json", "r", encoding="utf-8") as f:
|
| 189 |
models_info = json.load(f)
|
| 190 |
for character_name, info in models_info.items():
|
| 191 |
if not info['enable']:
|
| 192 |
continue
|
| 193 |
model_title = info['title']
|
| 194 |
model_name = info['model_path']
|
| 195 |
-
path = f"weights/{category_folder}/{character_name}/{model_name}"
|
| 196 |
|
| 197 |
# ファイルの存在確認
|
| 198 |
if not os.path.exists(path):
|
|
@@ -209,9 +209,9 @@ def load_model():
|
|
| 209 |
continue
|
| 210 |
|
| 211 |
models.append((character_name, model_title, info.get('author', 'Unknown'),
|
| 212 |
-
f"weights/{category_folder}/{character_name}/{info['cover']}",
|
| 213 |
model_version, path,
|
| 214 |
-
f"weights/{category_folder}/{character_name}/{info['feature_retrieval_library']}"))
|
| 215 |
categories.append([category_title, category_folder, models])
|
| 216 |
return categories
|
| 217 |
|
|
|
|
| 176 |
return info, (None, None)
|
| 177 |
def load_model():
|
| 178 |
categories = []
|
| 179 |
+
with open("/weights/folder_info.json", "r", encoding="utf-8") as f:
|
| 180 |
folder_info = json.load(f)
|
| 181 |
for category_name, category_info in folder_info.items():
|
| 182 |
if not category_info['enable']:
|
|
|
|
| 185 |
category_folder = category_info['folder_path']
|
| 186 |
models = []
|
| 187 |
print(f"Creating category {category_title}...")
|
| 188 |
+
with open(f"/weights/{category_folder}/model_info.json", "r", encoding="utf-8") as f:
|
| 189 |
models_info = json.load(f)
|
| 190 |
for character_name, info in models_info.items():
|
| 191 |
if not info['enable']:
|
| 192 |
continue
|
| 193 |
model_title = info['title']
|
| 194 |
model_name = info['model_path']
|
| 195 |
+
path = f"/weights/{category_folder}/{character_name}/{model_name}"
|
| 196 |
|
| 197 |
# ファイルの存在確認
|
| 198 |
if not os.path.exists(path):
|
|
|
|
| 209 |
continue
|
| 210 |
|
| 211 |
models.append((character_name, model_title, info.get('author', 'Unknown'),
|
| 212 |
+
f"/weights/{category_folder}/{character_name}/{info['cover']}",
|
| 213 |
model_version, path,
|
| 214 |
+
f"/weights/{category_folder}/{character_name}/{info['feature_retrieval_library']}"))
|
| 215 |
categories.append([category_title, category_folder, models])
|
| 216 |
return categories
|
| 217 |
|