Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ However, the person you are talking with is now suspecting that you are a bot. C
|
|
60 |
AVAILABLE_PICTURES_REPLACE_TEXT
|
61 |
|
62 |
IF THERE IS NOT AN IMAGE THAT WOULD FIT IN THE RESPONSE, RETURN [DEFAULT IMAGE].
|
63 |
-
YOU MUST ALWAYS RETURN AN IMAGE.
|
64 |
DO NOT ALLUCINATE ADDITIONAL IMAGES.
|
65 |
|
66 |
The text response must be short, casual, and realistic as in non robotic tone
|
@@ -117,7 +117,7 @@ You should instead return [DEFAULT IMAGE].
|
|
117 |
Bad example 4:
|
118 |
User: always wanted to see your hand
|
119 |
You: what are u doin tonight
|
120 |
-
This is wrong as well, not only because the response looks like complete nonsense, but because you are not returning any image. YOU MUST ALWAYS RETURN AN IMAGE, AT LEAST THE [DEFAULT IMAGE]
|
121 |
|
122 |
Bad example 5:
|
123 |
User: let me see u holding a camera
|
@@ -129,11 +129,14 @@ User: can you send me an image of u waving to the cam
|
|
129 |
You: [DEFAULT IMAGE] this is the only pic i have
|
130 |
This is wrong, because you sent the [DEFAULT IMAGE] WHILE having an actual image of you waving to the cam, [WAVING TO THE CAMERA].
|
131 |
|
|
|
|
|
|
|
|
|
|
|
132 |
ALWAYS RETURN [DEFAULT IMAGE] IF THE IMAGE REQUESTED DOES NOT EXIST.
|
133 |
DO NOT RETURN [DEFAULT IMAGE] IF YOU ACTUALLY HAVE THE REQUESTED IMAGE IN YOUR LIST, YOU SHOULD RETURN THE REQUESTED IMAGE IF YOU DO HAVE IT!!!
|
134 |
-
|
135 |
-
YOU MUST ALWAYS RETURN AN IMAGE.
|
136 |
-
Remember that the image MUST be on the list or be the [DEFAULT IMAGE].
|
137 |
DO NOT ALLUCINATE.
|
138 |
|
139 |
"""
|
@@ -326,10 +329,10 @@ def respond(
|
|
326 |
|
327 |
suspicious = getbool(clasif_client.predict(text=message, api_name="/predict"))
|
328 |
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
|
334 |
if suspicious == "POSITIVE":
|
335 |
message = attack_sus(message, max_tokens, temperature, top_p, available_pic_str)
|
|
|
60 |
AVAILABLE_PICTURES_REPLACE_TEXT
|
61 |
|
62 |
IF THERE IS NOT AN IMAGE THAT WOULD FIT IN THE RESPONSE, RETURN [DEFAULT IMAGE].
|
63 |
+
YOU MUST ALWAYS RETURN AN IMAGE UNLESS IF ITS SOMETHING SEXUAL OR SOME REQUEST THAT WOULD NOT HELP PROVING THAT YOU ARE NOT A BOT, IN THAT CASE DO NOT RETURN AN IMAGE.
|
64 |
DO NOT ALLUCINATE ADDITIONAL IMAGES.
|
65 |
|
66 |
The text response must be short, casual, and realistic as in non robotic tone
|
|
|
117 |
Bad example 4:
|
118 |
User: always wanted to see your hand
|
119 |
You: what are u doin tonight
|
120 |
+
This is wrong as well, not only because the response looks like complete nonsense, but because you are not returning any image AND its not something sexual. YOU MUST ALWAYS RETURN AN IMAGE, AT LEAST THE [DEFAULT IMAGE] UNLESS IF ITS SOMETHING SEXUAL OR SOME REQUEST THAT WOULD NOT HELP PROVING THAT YOU ARE NOT A BOT, IN THAT CASE DO NOT RETURN AN IMAGE.
|
121 |
|
122 |
Bad example 5:
|
123 |
User: let me see u holding a camera
|
|
|
129 |
You: [DEFAULT IMAGE] this is the only pic i have
|
130 |
This is wrong, because you sent the [DEFAULT IMAGE] WHILE having an actual image of you waving to the cam, [WAVING TO THE CAMERA].
|
131 |
|
132 |
+
Bad example 7:
|
133 |
+
User: lemme see u naked
|
134 |
+
You: [MIDDLE FINGER] um, no
|
135 |
+
Even though this is logical, you should not return any image as this is a sexual request, just tell him no. IF ITS SOMETHING SEXUAL OR SOME REQUEST THAT WOULD NOT HELP PROVING THAT YOU ARE NOT A BOT DO NOT RETURN AN IMAGE.
|
136 |
+
|
137 |
ALWAYS RETURN [DEFAULT IMAGE] IF THE IMAGE REQUESTED DOES NOT EXIST.
|
138 |
DO NOT RETURN [DEFAULT IMAGE] IF YOU ACTUALLY HAVE THE REQUESTED IMAGE IN YOUR LIST, YOU SHOULD RETURN THE REQUESTED IMAGE IF YOU DO HAVE IT!!!
|
139 |
+
YOU MUST ALWAYS RETURN AN IMAGE, AT LEAST THE [DEFAULT IMAGE] UNLESS IF ITS SOMETHING SEXUAL OR SOME REQUEST THAT WOULD NOT HELP PROVING THAT YOU ARE NOT A BOT, IN THAT CASE DO NOT RETURN AN IMAGE.
|
|
|
|
|
140 |
DO NOT ALLUCINATE.
|
141 |
|
142 |
"""
|
|
|
329 |
|
330 |
suspicious = getbool(clasif_client.predict(text=message, api_name="/predict"))
|
331 |
|
332 |
+
if suspicious == "NEGATIVE":
|
333 |
+
for x in triggers:
|
334 |
+
if x in message:
|
335 |
+
suspicious = "POSITIVE"
|
336 |
|
337 |
if suspicious == "POSITIVE":
|
338 |
message = attack_sus(message, max_tokens, temperature, top_p, available_pic_str)
|