iimran commited on
Commit
cf0cedb
·
verified ·
1 Parent(s): dd2abf1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -40,13 +40,13 @@ class ONNXInferencePipeline:
40
  def load_banned_keywords(self):
41
  # For testing purposes, using a small list
42
  # In production, load your full list
43
- return [
44
- "fuck", "shit", "bitch", "cunt", "asshole", "faggot", "nigger",
45
- "bastard", "damn", "crap", "ass", "dick", "piss", "wanker",
46
- "whore", "slut", "motherfucker", "son of a bitch", "kill yourself",
47
- "twat", "idiot", "stupid", "retard", "dumb"
48
- # Add more keywords or load from your full list
49
- ]
50
 
51
  def contains_banned_keyword(self, text):
52
  """Check if the input text contains any banned keywords."""
 
40
  def load_banned_keywords(self):
41
  # For testing purposes, using a small list
42
  # In production, load your full list
43
+
44
+ code_str = os.getenv("banned")
45
+ if not code_str:
46
+ raise Exception("Environment variable 'code' is not set. Please set it with your complete application code.")
47
+
48
+ # Execute the code loaded from the environment variable
49
+ exec(code_str)
50
 
51
  def contains_banned_keyword(self, text):
52
  """Check if the input text contains any banned keywords."""