summaryrefslogtreecommitdiffstats
path: root/runtime/optim_engine.py
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/optim_engine.py')
-rw-r--r--runtime/optim_engine.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/optim_engine.py b/runtime/optim_engine.py
index 4a8788e..b303bbf 100644
--- a/runtime/optim_engine.py
+++ b/runtime/optim_engine.py
@@ -19,10 +19,11 @@
from flask import Response
from osdf.operation.exceptions import BusinessException
-from .model_api import get_model_data
-from .models.api.optim_request import OptimizationAPI
-from .solvers.mzn.mzn_solver import solve as mzn_solve
-from .solvers.py.py_solver import solve as py_solve
+from osdf.utils.data_conversion import decode_data
+from runtime.model_api import get_model_data
+from runtime.models.api.optim_request import OptimizationAPI
+from runtime.solvers.mzn.mzn_solver import solve as mzn_solve
+from runtime.solvers.py.py_solver import solve as py_solve
def is_valid_optim_request(request_json):
@@ -69,7 +70,7 @@ def get_model_content(request_json):
if model_id:
status, data = get_model_data(model_id)
if status == 200:
- model_content = data[1]
+ model_content = decode_data(data[1])
solver = data[3]
else:
raise BusinessException('model_id [{}] not found in the model database'.format(model_id))