Jacobmadwed commited on
Commit
5f710c2
·
verified ·
1 Parent(s): 013f209

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +1 -1
handler.py CHANGED
@@ -181,7 +181,7 @@ class EndpointHandler:
181
  outputs = self.safety_checker(**inputs)
182
  logits_per_image = outputs.logits_per_image
183
  probs = logits_per_image.softmax(dim=1) # We assume the probability for NSFW content is stored in the first position
184
- return probs[0, 0] > 0.5 # This threshold may need to be adjusted
185
 
186
  request = GenerateImageRequest(**data)
187
  inputs = request.inputs
 
181
  outputs = self.safety_checker(**inputs)
182
  logits_per_image = outputs.logits_per_image
183
  probs = logits_per_image.softmax(dim=1) # We assume the probability for NSFW content is stored in the first position
184
+ return probs[0, 1] > 0.5 # This threshold may need to be adjusted
185
 
186
  request = GenerateImageRequest(**data)
187
  inputs = request.inputs