Update utils.py
Browse files
utils.py
CHANGED
@@ -1,28 +1,34 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
SAFETY_SETTINGS = [
|
4 |
{
|
5 |
"category": "HARM_CATEGORY_SEXUAL",
|
6 |
-
"threshold": "
|
7 |
},
|
8 |
{
|
9 |
"category": "HARM_CATEGORY_DANGEROUS",
|
10 |
-
"threshold": "
|
11 |
},
|
12 |
{
|
13 |
"category": "HARM_CATEGORY_HARASSMENT",
|
14 |
-
"threshold": "
|
15 |
},
|
16 |
{
|
17 |
"category": "HARM_CATEGORY_HATE_SPEECH",
|
18 |
-
"threshold": "
|
19 |
},
|
20 |
{
|
21 |
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
22 |
-
"threshold": "
|
23 |
},
|
24 |
{
|
25 |
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
|
26 |
-
"threshold": "
|
27 |
},
|
28 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Original code
|
2 |
+
SAFETY_SETTTINGS = [
|
|
|
3 |
{
|
4 |
"category": "HARM_CATEGORY_SEXUAL",
|
5 |
+
"threshold": "BLOCK_ONLY_HIGH",
|
6 |
},
|
7 |
{
|
8 |
"category": "HARM_CATEGORY_DANGEROUS",
|
9 |
+
"threshold": "BLOCK_ONLY_HIGH",
|
10 |
},
|
11 |
{
|
12 |
"category": "HARM_CATEGORY_HARASSMENT",
|
13 |
+
"threshold": "BLOCK_ONLY_HIGH",
|
14 |
},
|
15 |
{
|
16 |
"category": "HARM_CATEGORY_HATE_SPEECH",
|
17 |
+
"threshold": "BLOCK_ONLY_HIGH",
|
18 |
},
|
19 |
{
|
20 |
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
21 |
+
"threshold": "BLOCK_ONLY_HIGH",
|
22 |
},
|
23 |
{
|
24 |
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
|
25 |
+
"threshold": "BLOCK_ONLY_HIGH",
|
26 |
},
|
27 |
]
|
28 |
+
|
29 |
+
# Modified code to allow uninterrupted chat session
|
30 |
+
MODIFIED_SAFETY_SETTTINGS = []
|
31 |
+
|
32 |
+
# Set all thresholds to "ALLOW_ALL" to disable blocking
|
33 |
+
for setting in MODIFIED_SAFETY_SETTTINGS:
|
34 |
+
setting["threshold"] = "ALLOW_ALL"
|