Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -174,7 +174,7 @@ def infer(name, path, index, vc_input, vc_upload, tts_text, tts_voice, f0_up_key
|
|
174 |
info = traceback.format_exc()
|
175 |
print(info)
|
176 |
return info, (None, None)
|
177 |
-
|
178 |
def load_model():
|
179 |
categories = []
|
180 |
with open("/weights/folder_info.json", "r", encoding="utf-8") as f:
|
@@ -203,7 +203,7 @@ def load_model():
|
|
203 |
if not (model_author in authors or "/" in model_author or "&" in model_author):
|
204 |
authors.append(model_author)
|
205 |
model_path = f"/weights/{category_folder}/{character_name}/{model_name}"
|
206 |
-
cpt = torch.load(f"/weights/{category_folder}/{character_name}/{model_name}", map_location="cpu")
|
207 |
model_version = cpt.get("version", "v1")
|
208 |
print(f"Indexed model {model_title} by {model_author} ({model_version})")
|
209 |
models.append((character_name, model_title, model_author, model_cover, model_version, model_path, model_index))
|
|
|
174 |
info = traceback.format_exc()
|
175 |
print(info)
|
176 |
return info, (None, None)
|
177 |
+
import pickle
|
178 |
def load_model():
|
179 |
categories = []
|
180 |
with open("/weights/folder_info.json", "r", encoding="utf-8") as f:
|
|
|
203 |
if not (model_author in authors or "/" in model_author or "&" in model_author):
|
204 |
authors.append(model_author)
|
205 |
model_path = f"/weights/{category_folder}/{character_name}/{model_name}"
|
206 |
+
cpt = torch.load(f"/weights/{category_folder}/{character_name}/{model_name}", map_location="cpu", pickle_module=pickle)
|
207 |
model_version = cpt.get("version", "v1")
|
208 |
print(f"Indexed model {model_title} by {model_author} ({model_version})")
|
209 |
models.append((character_name, model_title, model_author, model_cover, model_version, model_path, model_index))
|