Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -131,16 +131,16 @@ def is_caption_safe(caption):
|
|
| 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 |
-
|
| 143 |
-
return True
|
| 144 |
|
| 145 |
|
| 146 |
|
|
|
|
| 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
|
| 144 |
|
| 145 |
|
| 146 |
|