dariadaria commited on
Commit
0f33f24
·
1 Parent(s): 3f14abd

reverse reshaping handler output

Browse files
Files changed (1) hide show
  1. handler.py +2 -4
handler.py CHANGED
@@ -47,7 +47,5 @@ class EndpointHandler:
47
  output = self.model(**tokenized_inputs)
48
  predictions = torch.argmax(output.logits, dim=-1).numpy(force=True)
49
  batch['label'] = [self.model.config.id2label[p] for p in predictions]
50
-
51
- n = len(test_dict['id'])
52
- result = [{key : value[i] for key, value in test_dict.items() if key not in ('text')} for i in range(n)]
53
- return result
 
47
  output = self.model(**tokenized_inputs)
48
  predictions = torch.argmax(output.logits, dim=-1).numpy(force=True)
49
  batch['label'] = [self.model.config.id2label[p] for p in predictions]
50
+ batch.pop('text')
51
+ return batch