Update app.py
Browse files
app.py
CHANGED
@@ -38,10 +38,14 @@ def infer(prompt):
|
|
38 |
""")
|
39 |
is_safe = safety_check(prompt)
|
40 |
print(is_safe)
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
45 |
if status == "Yes" :
|
46 |
raise gr.Error("Don't ask for such things.")
|
47 |
else:
|
|
|
38 |
""")
|
39 |
is_safe = safety_check(prompt)
|
40 |
print(is_safe)
|
41 |
+
|
42 |
+
match = re.search(r'\bYes\b', is_safe)
|
43 |
+
|
44 |
+
if match:
|
45 |
+
status = 'Yes'
|
46 |
+
else:
|
47 |
+
status = None
|
48 |
+
|
49 |
if status == "Yes" :
|
50 |
raise gr.Error("Don't ask for such things.")
|
51 |
else:
|