Upload handler.py
Browse files- handler.py +6 -10
handler.py
CHANGED
@@ -18,17 +18,13 @@ class EndpointHandler:
|
|
18 |
A :obj:`list` | `dict`: will be serialized and returned
|
19 |
"""
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
encrypted_inputs = data.pop("encrypted_inputs", data)
|
24 |
|
25 |
-
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
else:
|
32 |
-
return 42
|
33 |
|
34 |
return encrypted_prediction
|
|
|
18 |
A :obj:`list` | `dict`: will be serialized and returned
|
19 |
"""
|
20 |
|
21 |
+
# Get inputs
|
22 |
+
encrypted_inputs = data.pop("encrypted_inputs", data)
|
|
|
23 |
|
24 |
+
# Get keys
|
25 |
+
evaluation_keys = data.pop("evaluation_keys", data)
|
26 |
|
27 |
+
# Run CML prediction
|
28 |
+
encrypted_prediction = self.fhemodel_server.run(encrypted_inputs, evaluation_keys)
|
|
|
|
|
|
|
29 |
|
30 |
return encrypted_prediction
|