Fediory commited on
Commit
f625260
·
1 Parent(s): 6319557

fix: weights

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -14,7 +14,7 @@ eval_net.trans.gated = True
14
  eval_net.trans.gated2 = True
15
 
16
  def process_image(input_img,score,model_path,gamma=1.0,alpha_s=1.0,alpha_i=1.0):
17
- if len(model_path) == 0:
18
  return input_img,"Please choose a model weights.","Please choose a model weights."
19
  torch.set_grad_enabled(False)
20
  eval_net.load_state_dict(torch.load(os.path.join(directory,model_path), map_location=lambda storage, loc: storage))
 
14
  eval_net.trans.gated2 = True
15
 
16
  def process_image(input_img,score,model_path,gamma=1.0,alpha_s=1.0,alpha_i=1.0):
17
+ if model_path is None:
18
  return input_img,"Please choose a model weights.","Please choose a model weights."
19
  torch.set_grad_enabled(False)
20
  eval_net.load_state_dict(torch.load(os.path.join(directory,model_path), map_location=lambda storage, loc: storage))