Spaces:
Running
Running
Update fn.py
Browse files
fn.py
CHANGED
@@ -26,6 +26,9 @@ def load_model():
|
|
26 |
)
|
27 |
|
28 |
def check(image):
|
|
|
|
|
|
|
29 |
images = [image]
|
30 |
safety_checker_input = feature_extractor(images, return_tensors="pt").to(device)
|
31 |
images_np = [np.array(img) for img in images]
|
|
|
26 |
)
|
27 |
|
28 |
def check(image):
|
29 |
+
if not image:
|
30 |
+
return None
|
31 |
+
|
32 |
images = [image]
|
33 |
safety_checker_input = feature_extractor(images, return_tensors="pt").to(device)
|
34 |
images_np = [np.array(img) for img in images]
|