Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -21,10 +21,10 @@ class EndpointHandler():
|
|
| 21 |
|
| 22 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 23 |
inputs = data.pop("inputs", data)
|
| 24 |
-
parameters = data.pop("parameters")
|
| 25 |
|
| 26 |
# pass inputs with all kwargs in data
|
| 27 |
-
if parameters:
|
| 28 |
prediction = self.pipe(inputs, **parameters)
|
| 29 |
else:
|
| 30 |
prediction = self.pipe(inputs)
|
|
|
|
| 21 |
|
| 22 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 23 |
inputs = data.pop("inputs", data)
|
| 24 |
+
parameters = data.pop("parameters", None)
|
| 25 |
|
| 26 |
# pass inputs with all kwargs in data
|
| 27 |
+
if parameters is not None:
|
| 28 |
prediction = self.pipe(inputs, **parameters)
|
| 29 |
else:
|
| 30 |
prediction = self.pipe(inputs)
|