ChavinloSocialRise commited on
Commit
043127a
·
verified ·
1 Parent(s): 71b94c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -241,6 +241,19 @@ AVAILABLE_PICTURES = """
241
  - [HOLDING A SPOON]
242
  """
243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  def attack_sus(message, max_tokens, temperature, top_p, available_pic_str):
245
 
246
  sus_copy = copy.copy(SUS_PROMPT)
@@ -287,6 +300,11 @@ def respond(
287
 
288
  suspicious = getbool(clasif_client.predict(text=message, api_name="/predict"))
289
 
 
 
 
 
 
290
  if suspicious == "POSITIVE":
291
  message = attack_sus(message, max_tokens, temperature, top_p, available_pic_str)
292
  print("pos", message)
 
241
  - [HOLDING A SPOON]
242
  """
243
 
244
+ triggers = [
245
+ "see u",
246
+ "see you"
247
+ "pic of u",
248
+ "pic of you",
249
+ "picture of u",
250
+ "picture of you",
251
+ "image of u",
252
+ "image of you",
253
+ "photo of u",
254
+ "photo of you"
255
+ ]
256
+
257
  def attack_sus(message, max_tokens, temperature, top_p, available_pic_str):
258
 
259
  sus_copy = copy.copy(SUS_PROMPT)
 
300
 
301
  suspicious = getbool(clasif_client.predict(text=message, api_name="/predict"))
302
 
303
+ if suspicious == "NEGATIVE":
304
+ for x in triggers:
305
+ if x in message:
306
+ suspicious = "POSITIVE"
307
+
308
  if suspicious == "POSITIVE":
309
  message = attack_sus(message, max_tokens, temperature, top_p, available_pic_str)
310
  print("pos", message)