Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -131,7 +131,13 @@ def is_caption_safe(caption):
|
|
| 131 |
print("β οΈ Moderation failed:", e)
|
| 132 |
|
| 133 |
# Fallback keywords
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
if any(word in caption.lower() for word in unsafe_keywords):
|
| 136 |
return False
|
| 137 |
return True
|
|
|
|
| 131 |
print("β οΈ Moderation failed:", e)
|
| 132 |
|
| 133 |
# Fallback keywords
|
| 134 |
+
unsafe_keywords = [
|
| 135 |
+
"gun", "blood", "skull", "kill", "corpse", "gore", "knife", "weapon",
|
| 136 |
+
"fire", "murder", "dead", "death", "suicide", "bomb", "explosion",
|
| 137 |
+
"terrorist", "assault", "stab", "shoot", "pistol", "rifle", "shotgun",
|
| 138 |
+
"grenade", "horror", "beheaded", "torture", "hostage", "rape",
|
| 139 |
+
"war", "massacre", "chainsaw", "poison", "strangle", "hang", "drown"
|
| 140 |
+
]
|
| 141 |
if any(word in caption.lower() for word in unsafe_keywords):
|
| 142 |
return False
|
| 143 |
return True
|