MayZhou commited on
Commit
d620c51
·
verified ·
1 Parent(s): 2424f5b

Update handler.py

Browse files
Files changed (1) hide show
  1. 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, inputs):
 
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':