Pierce Maloney
commited on
Commit
•
0e224b1
1
Parent(s):
b29c898
banning Admitted and Abort
Browse files- handler.py +4 -2
- test_tokenizer +0 -0
handler.py
CHANGED
@@ -22,9 +22,11 @@ class EndpointHandler():
|
|
22 |
inputs = data.pop("inputs", data)
|
23 |
|
24 |
|
25 |
-
#
|
26 |
# 13 is a newline character
|
27 |
-
|
|
|
|
|
28 |
|
29 |
input_ids = self.tokenizer.encode(inputs, return_tensors="pt")
|
30 |
|
|
|
22 |
inputs = data.pop("inputs", data)
|
23 |
|
24 |
|
25 |
+
# 3070, 10456, [313, 334] corresponds to "(*", and we do not want to output a comment
|
26 |
# 13 is a newline character
|
27 |
+
# [1976, 441, 29889] is "Abort."
|
28 |
+
# [2087, 29885, 4430, 29889] is "Admitted."
|
29 |
+
bad_words_ids = [[3070], [313, 334], [10456], [13], [1976, 441, 29889], [2087, 29885, 4430, 29889]]
|
30 |
|
31 |
input_ids = self.tokenizer.encode(inputs, return_tensors="pt")
|
32 |
|
test_tokenizer
DELETED
File without changes
|