Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -52,8 +52,8 @@ class EndpointHandler():
|
|
| 52 |
result_array = []
|
| 53 |
if (indices_array):
|
| 54 |
for result_indices in indices_array:
|
| 55 |
-
text = self.tokenizer.decode(input_ids[result_indices[0]:result_indices[-1]])
|
| 56 |
-
indices = [offset_mapping[result_indices[0]][0], offset_mapping[result_indices[-1]][1]]
|
| 57 |
if text != "" and not text.isspace():
|
| 58 |
while True:
|
| 59 |
if text[0] == " ":
|
|
|
|
| 52 |
result_array = []
|
| 53 |
if (indices_array):
|
| 54 |
for result_indices in indices_array:
|
| 55 |
+
text = self.tokenizer.decode(input_ids[result_indices[0]:result_indices[-1]+1])
|
| 56 |
+
indices = [offset_mapping[result_indices[0]][0], offset_mapping[result_indices[-1]+1][1]]
|
| 57 |
if text != "" and not text.isspace():
|
| 58 |
while True:
|
| 59 |
if text[0] == " ":
|