Pierce Maloney
commited on
Commit
•
4c4f932
1
Parent(s):
d8be130
arg name change, Abort
Browse files- handler.py +3 -3
handler.py
CHANGED
@@ -20,14 +20,14 @@ class EndpointHandler():
|
|
20 |
A :obj:`list` | `dict`: will be serialized and returned
|
21 |
"""
|
22 |
inputs = data.pop("inputs", data)
|
23 |
-
additional_bad_words_ids = data.pop("
|
24 |
|
25 |
|
26 |
# 3070, 10456, [313, 334] corresponds to "(*", and we do not want to output a comment
|
27 |
# 13 is a newline character
|
28 |
-
# [1976, 441, 29889], [4920, 441, 29889] is "Abort." [4920, 18054, 29889] is "Aborted."
|
29 |
# [2087, 29885, 4430, 29889] is "Admitted."
|
30 |
-
bad_words_ids = [[3070], [313, 334], [10456], [13], [1976, 441, 29889], [2087, 29885, 4430, 29889], [4920, 441, 29889], [4920, 18054, 29889]]
|
31 |
bad_words_ids.extend(additional_bad_words_ids)
|
32 |
|
33 |
input_ids = self.tokenizer.encode(inputs, return_tensors="pt")
|
|
|
20 |
A :obj:`list` | `dict`: will be serialized and returned
|
21 |
"""
|
22 |
inputs = data.pop("inputs", data)
|
23 |
+
additional_bad_words_ids = data.pop("additional_bad_words_ids", [])
|
24 |
|
25 |
|
26 |
# 3070, 10456, [313, 334] corresponds to "(*", and we do not want to output a comment
|
27 |
# 13 is a newline character
|
28 |
+
# [1976, 441, 29889], [4920, 441, 29889] is "Abort." [4920, 18054, 29889] is "Aborted."
|
29 |
# [2087, 29885, 4430, 29889] is "Admitted."
|
30 |
+
bad_words_ids = [[3070], [313, 334], [10456], [13], [1976, 441, 29889], [2087, 29885, 4430, 29889], [4920, 441], [4920, 441, 29889], [4920, 18054, 29889]]
|
31 |
bad_words_ids.extend(additional_bad_words_ids)
|
32 |
|
33 |
input_ids = self.tokenizer.encode(inputs, return_tensors="pt")
|