diff --git a/cvpm/server.py b/cvpm/server.py index 60f9d8a1e..fed8abfb7 100644 --- a/cvpm/server.py +++ b/cvpm/server.py @@ -88,8 +88,9 @@ def train(): return json.dumps({"error": "not supported!", "code": "404"}), 404 -def run_server(solver): - port = get_available_port() +def run_server(solver, port=None): + if port is None: + port = get_available_port() logger.info("Server Running On: " + str(port)) with server.app_context(): server.solver = solver diff --git a/cvpm/solver.py b/cvpm/solver.py index 7b2ca1f10..c3716b703 100644 --- a/cvpm/solver.py +++ b/cvpm/solver.py @@ -55,5 +55,5 @@ def infer(self, input, config): def train(self, train_x, train_y, **kwargs): pass - def start(self): - run_server(self) + def start(self, port=None): + run_server(self, port)