Skip to content

Commit

Permalink
fix: Content Safety not found throw error
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Feb 22, 2024
1 parent 737566f commit 6ac0810
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helpers/llm_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _contentsafety_category_test(
if score == 0:
return True # No need to check severity

detection = next(item for item in res if item.category == category)
detection = next((item for item in res if item.category == category), None)

if detection and detection.severity and detection.severity > score:
_logger.debug(f"Matched {category} with severity {detection.severity}")
Expand Down

0 comments on commit 6ac0810

Please sign in to comment.