soiz1 commited on
Commit
3b5feb8
·
verified ·
1 Parent(s): d8ce271

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -203,7 +203,8 @@ 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))
 
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
+ import pickle
207
+ cpt = torch.load(f"/weights/{category_folder}/{character_name}/{model_name}", map_location="cpu", pickle_module=pickle)
208
  model_version = cpt.get("version", "v1")
209
  print(f"Indexed model {model_title} by {model_author} ({model_version})")
210
  models.append((character_name, model_title, model_author, model_cover, model_version, model_path, model_index))