add custom handler and modify pipeline
Browse files
__pycache__/bert_for_sequence_classification.cpython-37.pyc
CHANGED
|
Binary files a/__pycache__/bert_for_sequence_classification.cpython-37.pyc and b/__pycache__/bert_for_sequence_classification.cpython-37.pyc differ
|
|
|
__pycache__/bibert_multitask_classification.cpython-37.pyc
CHANGED
|
Binary files a/__pycache__/bibert_multitask_classification.cpython-37.pyc and b/__pycache__/bibert_multitask_classification.cpython-37.pyc differ
|
|
|
__pycache__/handler.cpython-37.pyc
CHANGED
|
Binary files a/__pycache__/handler.cpython-37.pyc and b/__pycache__/handler.cpython-37.pyc differ
|
|
|
handler.py
CHANGED
|
@@ -46,9 +46,13 @@ class EndpointHandler():
|
|
| 46 |
Return:
|
| 47 |
A :obj:`list` | `dict`: will be serialized and returned
|
| 48 |
"""
|
| 49 |
-
|
| 50 |
inputs = data.pop("inputs", data)
|
| 51 |
lang = data.pop("lang", None)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
prediction_p = self.classifier_p(inputs)
|
| 54 |
label = prediction_p[0]['label']
|
|
|
|
| 46 |
Return:
|
| 47 |
A :obj:`list` | `dict`: will be serialized and returned
|
| 48 |
"""
|
| 49 |
+
|
| 50 |
inputs = data.pop("inputs", data)
|
| 51 |
lang = data.pop("lang", None)
|
| 52 |
+
logger.info(inputs)
|
| 53 |
+
logger.info(lang)
|
| 54 |
+
if isinstance(inputs, str):
|
| 55 |
+
inputs = [inputs]
|
| 56 |
|
| 57 |
prediction_p = self.classifier_p(inputs)
|
| 58 |
label = prediction_p[0]['label']
|