show obj
Browse files- handler.py +2 -3
handler.py
CHANGED
|
@@ -8,6 +8,7 @@ from diffusers import StableDiffusionControlNetPipeline, ControlNetModel
|
|
| 8 |
from transformers import AutoProcessor, SafetyChecker
|
| 9 |
#from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
import torch
|
| 13 |
|
|
@@ -138,9 +139,7 @@ class EndpointHandler():
|
|
| 138 |
safety_features = processor(image)
|
| 139 |
safety_check_result = safety_checker(images=image, features=safety_features)
|
| 140 |
|
| 141 |
-
|
| 142 |
-
print(f'Ocurri贸 un error: {safety_check_result["nsfw_content_detected"]')
|
| 143 |
-
|
| 144 |
|
| 145 |
# run inference pipeline
|
| 146 |
out = self.pipe(
|
|
|
|
| 8 |
from transformers import AutoProcessor, SafetyChecker
|
| 9 |
#from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
|
| 10 |
|
| 11 |
+
import pprint
|
| 12 |
|
| 13 |
import torch
|
| 14 |
|
|
|
|
| 139 |
safety_features = processor(image)
|
| 140 |
safety_check_result = safety_checker(images=image, features=safety_features)
|
| 141 |
|
| 142 |
+
pprint(safety_check_result)
|
|
|
|
|
|
|
| 143 |
|
| 144 |
# run inference pipeline
|
| 145 |
out = self.pipe(
|