File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,18 @@ def contain_blocked_words(val: str) -> bool:
71
71
return False
72
72
73
73
74
+ def contain_blocked_responses (role : str , val : str ) -> bool :
75
+ if role == "gpt" :
76
+ blocked_responses = [
77
+ "Too many requests in 1 hour. Try again later." ,
78
+ "!Too many requests in 1 hour. Try again later." ,
79
+ ]
80
+ for w in blocked_responses :
81
+ if val .startswith (w ):
82
+ return True
83
+ return False
84
+
85
+
74
86
def clean_html_one_sample (sample ):
75
87
roles = ["human" , "gpt" ]
76
88
@@ -102,6 +114,9 @@ def clean_html_one_sample(sample):
102
114
except (bs4 .builder .ParserRejectedMarkup , AssertionError ):
103
115
return (sample , 4 )
104
116
117
+ if contain_blocked_responses (c ["from" ], new_val ):
118
+ return (sample , 3 )
119
+
105
120
# Filter empty answers like https://sharegpt.com/c/mrllZ6u
106
121
if not new_val or not new_val [0 ].isprintable ():
107
122
break
You can’t perform that action at this time.
0 commit comments