ekolasky commited on
Commit
4983fe7
1 Parent(s): bf8eaa2

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -52,10 +52,10 @@ class EndpointHandler():
52
  result_array = []
53
  if (indices_array):
54
  for result_indices in indices_array:
55
- name = self.tokenizer.decode(input_ids[result_indices[0]:result_indices[-1]]).strip()
56
  indices = [offset_mapping[result_indices[0]][0], offset_mapping[result_indices[-1]][0]]
57
- if name != " " and name != "":
58
- result_array.append({'name': name, 'indices': indices})
59
  return result_array
60
 
61
 
 
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]]).strip()
56
  indices = [offset_mapping[result_indices[0]][0], offset_mapping[result_indices[-1]][0]]
57
+ if text != " " and text != "":
58
+ result_array.append({'text': text, 'indices': indices})
59
  return result_array
60
 
61