gopalagra commited on
Commit
a5f24a2
·
verified ·
1 Parent(s): 6167220

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- return False
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