adamluc commited on
Commit
3a8bc10
·
1 Parent(s): 05ffe76

Upload handler.py

Browse files
Files changed (1) hide show
  1. handler.py +9 -2
handler.py CHANGED
@@ -12,5 +12,12 @@ class EndpointHandler:
12
 
13
  def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
14
  inputs = data.pop("inputs", data)
15
-
16
- return inputs
 
 
 
 
 
 
 
 
12
 
13
  def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
14
  inputs = data.pop("inputs", data)
15
+ parameters = data.pop("parameters", None)
16
+
17
+ # pass inputs with all kwargs in data
18
+ if parameters is not None:
19
+ prediction = self.pipeline(inputs, **parameters)
20
+ else:
21
+ prediction = self.pipeline(inputs)
22
+ # postprocess the prediction
23
+ return prediction