abidlabs HF staff commited on
Commit
bb777cc
β€’
1 Parent(s): 244bac2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -30,6 +30,9 @@ model.load_state_dict(state_dict, strict=False)
30
  model.eval()
31
 
32
  def predict(im):
 
 
 
33
  x = torch.tensor(im, dtype=torch.float32).unsqueeze(0).unsqueeze(0) / 255.
34
 
35
  with torch.no_grad():
 
30
  model.eval()
31
 
32
  def predict(im):
33
+ if im is None:
34
+ return None
35
+
36
  x = torch.tensor(im, dtype=torch.float32).unsqueeze(0).unsqueeze(0) / 255.
37
 
38
  with torch.no_grad():