Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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():
|