Kalaoke commited on
Commit
58c3574
·
1 Parent(s): 2c5bd8b

add custom handler and modify pipeline

Browse files
Files changed (1) hide show
  1. handler.py +2 -4
handler.py CHANGED
@@ -44,10 +44,8 @@ class EndpointHandler():
44
  Return:
45
  A :obj:`list` | `dict`: will be serialized and returned
46
  """
47
- inputs = data.pop("text", data)
48
- lang = data.pop("lang", data)
49
- if isinstance(inputs, str):
50
- inputs = [inputs]
51
 
52
  prediction_p = self.classifier_p(inputs)
53
  label = prediction_p[0]['label']
 
44
  Return:
45
  A :obj:`list` | `dict`: will be serialized and returned
46
  """
47
+ inputs = data.pop("inputs", data)
48
+ lang = data.pop("lang", None)
 
 
49
 
50
  prediction_p = self.classifier_p(inputs)
51
  label = prediction_p[0]['label']