yeq6x commited on
Commit
9214654
1 Parent(s): fca9328
Files changed (2) hide show
  1. requirements.txt +1 -1
  2. scripts/model.py +1 -1
requirements.txt CHANGED
@@ -2,7 +2,7 @@
2
  torch==2.2.0
3
  torchvision==0.17.0
4
  torchaudio==2.2.0
5
- diffusers==0.29.1
6
  Flask==3.0.3
7
  Flask-Cors==4.0.0
8
  Flask-SocketIO==5.3.6
 
2
  torch==2.2.0
3
  torchvision==0.17.0
4
  torchaudio==2.2.0
5
+ diffusers==0.27.4 # pth file cannot be loaded in the latest version
6
  Flask==3.0.3
7
  Flask-Cors==4.0.0
8
  Flask-SocketIO==5.3.6
scripts/model.py CHANGED
@@ -154,7 +154,7 @@ def create_model(model, use_local):
154
 
155
  import os
156
  if model == 'default':
157
- model_path = (lambda filename, subfolder: os.path.join(subfolder, filename) if use_local else download_file(filename, subfolder))("netG.pth", "models/Anime2Sketch")
158
 
159
  ckpt = torch.load(model_path)
160
  for key in list(ckpt.keys()):
 
154
 
155
  import os
156
  if model == 'default':
157
+ model_path = "models/Anime2Sketch/netG.pth" if use_local else download_file("netG.pth", "models/Anime2Sketch")
158
 
159
  ckpt = torch.load(model_path)
160
  for key in list(ckpt.keys()):