add custom handler and modify pipeline
Browse files- 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("
|
| 48 |
-
lang = data.pop("lang",
|
| 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']
|