Update handler.py
Browse files- handler.py +2 -1
handler.py
CHANGED
|
@@ -13,7 +13,8 @@ class EndpointHandler:
|
|
| 13 |
"text-classification", model=model, tokenizer=tokenizer
|
| 14 |
)
|
| 15 |
|
| 16 |
-
def __call__(self,
|
|
|
|
| 17 |
result = self.pipeline(inputs, truncation=True, padding=False, max_length=512)
|
| 18 |
for item in result:
|
| 19 |
if item['label'] == 'LABEL_0':
|
|
|
|
| 13 |
"text-classification", model=model, tokenizer=tokenizer
|
| 14 |
)
|
| 15 |
|
| 16 |
+
def __call__(self, data):
|
| 17 |
+
inputs = data.pop("inputs", data)
|
| 18 |
result = self.pipeline(inputs, truncation=True, padding=False, max_length=512)
|
| 19 |
for item in result:
|
| 20 |
if item['label'] == 'LABEL_0':
|