ekolasky commited on
Commit
fed03d4
·
1 Parent(s): f7a2749

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -24,9 +24,9 @@ class EndpointHandler():
24
  - "label": A string representing what the label/class is. There can be multiple labels.
25
  - "score": A score between 0 and 1 describing how confident the model is for this label/class.
26
  """
27
- text = data.pop("text", data)
28
- label_tolerance = data.pop("label_tolerance", 0)
29
- backup_tolerance = data.pop("backup_tolerance", None)
30
 
31
  # Return labeled results and backup results based on tolerances
32
  inputs = self.preprocess_text(text)
 
24
  - "label": A string representing what the label/class is. There can be multiple labels.
25
  - "score": A score between 0 and 1 describing how confident the model is for this label/class.
26
  """
27
+ text = data['inputs'].pop("text", "")
28
+ label_tolerance = data['inputs'].pop("label_tolerance", 0)
29
+ backup_tolerance = data['inputs'].pop("backup_tolerance", None)
30
 
31
  # Return labeled results and backup results based on tolerances
32
  inputs = self.preprocess_text(text)