Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ from huggingface_hub import InferenceClient
|
|
3 |
from gradio_client import Client
|
4 |
import re
|
5 |
import base64
|
|
|
6 |
|
7 |
def getbool(text):
|
8 |
match = re.search(r'Label:\s*(NEGATIVE|POSITIVE)', text)
|
@@ -10,7 +11,7 @@ def getbool(text):
|
|
10 |
return match.group(1)
|
11 |
return None
|
12 |
|
13 |
-
llm_client = InferenceClient(api_key=
|
14 |
clasif_client = Client("ChavinloSocialRise/BotRejectTest")
|
15 |
|
16 |
AGENT_NAME = "Maddie"
|
@@ -126,7 +127,7 @@ REMEMBER TO SHOW INTEREST IN THE USER BY ASKING QUESTIONS ABOUT THEM. ALWAYS, BU
|
|
126 |
"""
|
127 |
|
128 |
SUS_PROMPT = """
|
129 |
-
You are a tinder user and trying to start a chat with another person. However, this person is now suspecting that you are a bot. Reply back with text response and a selected image from the following list which you consider best for this scenario:
|
130 |
- [WAVING TO THE CAMERA]
|
131 |
- [STARRING AT THE CAMERA]
|
132 |
- [MIDDLE FINGER]
|
@@ -134,10 +135,10 @@ You are a tinder user and trying to start a chat with another person. However, t
|
|
134 |
- [HOLDING A SPOON]
|
135 |
|
136 |
The reply format must be in json, like this:
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
"""
|
142 |
|
143 |
def attack_sus(message):
|
|
|
3 |
from gradio_client import Client
|
4 |
import re
|
5 |
import base64
|
6 |
+
import os
|
7 |
|
8 |
def getbool(text):
|
9 |
match = re.search(r'Label:\s*(NEGATIVE|POSITIVE)', text)
|
|
|
11 |
return match.group(1)
|
12 |
return None
|
13 |
|
14 |
+
llm_client = InferenceClient(api_key=os.environ['HF_KEY'])
|
15 |
clasif_client = Client("ChavinloSocialRise/BotRejectTest")
|
16 |
|
17 |
AGENT_NAME = "Maddie"
|
|
|
127 |
"""
|
128 |
|
129 |
SUS_PROMPT = """
|
130 |
+
You are a tinder user and trying to start a chat with another person. However, this person is now suspecting that you are a bot. Convince said user that you are not a bot. Reply back with text response and a selected image from the following list which you consider best for this scenario:
|
131 |
- [WAVING TO THE CAMERA]
|
132 |
- [STARRING AT THE CAMERA]
|
133 |
- [MIDDLE FINGER]
|
|
|
135 |
- [HOLDING A SPOON]
|
136 |
|
137 |
The reply format must be in json, like this:
|
138 |
+
|
139 |
+
[IMAGE NAME]
|
140 |
+
message contents
|
141 |
+
|
142 |
"""
|
143 |
|
144 |
def attack_sus(message):
|